HTML (RTF) Keep format but remove headings <html> etc (1 Viewer)

bignose2

Registered User.
Local time
Today, 07:42
Joined
May 2, 2010
Messages
219
Hi,

I use html & rtf in forms for emailing via access
however I create my own emails and then add them in front of the existing incoming email.

Problem is the incoming email often has e.g.
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<title>Test bob 20-Nov-2019 To 10-Dec-2019 - CheckQuote</title>
</head>
<body>

If these extra tag headings are in the middle of my resulting string it results in very messed up formatting.

I want to keep most formatting so cannot simply use Plain Text function.
Some incoming have this or a variety of different Tags or in the case of Gmail no headers tags at all, these are fine without checking.

I can use replace and remove the ones above but wondered if there was a better more reliable method. There are so many different formats I guess could miss some & want to leave as many tags as I can

Thanks IA
 

jdraw

Super Moderator
Staff member
Local time
Today, 02:42
Joined
Jan 23, 2006
Messages
15,378
Just thinking and typing -- if you want to add your info right after <body> for example, you could read through the incoming email, find the <body> tag, then put the intro info into a variable, then add your info from a file or variable to the existing body,
then attach the origin intro info to the start of the revised body.

I think you'll have to research/review some samples in order to refine what will work in mot situations.
Good luck
 

Users who are viewing this thread

Top Bottom