> Apologies if this has been covered before - I couldn't find it.
>
[quoted text clipped - 17 lines]
> Thanks
> Dave
Thanks Lyle
But one of my problems is the subject line. Using either your suggested
code, or the system I'm currently using, I need to convert the raw HTML
into a text string, and that's the bit that takes the time because my
client likes designing some pretty long emails loads of tables, font
changes etc etc. I have it all sussed, putting in graphics and
variables and so on, and it works beautifully. I'm just trying to find
a short cut really.
Dave
> > Apologies if this has been covered before - I couldn't find it.
> >
[quoted text clipped - 85 lines]
> (personalized or not) to a server and sending a link to that page in
> the e-mail. I have code for that too.
Rick Brandt - 10 Jun 2006 12:29 GMT
> Thanks Lyle
>
[quoted text clipped - 5 lines]
> graphics and variables and so on, and it works beautifully. I'm just
> trying to find a short cut really.
Put the base "template" HTML in a memo
Rick Brandt - 10 Jun 2006 12:32 GMT
> Thanks Lyle
>
[quoted text clipped - 5 lines]
> graphics and variables and so on, and it works beautifully. I'm just
> trying to find a short cut really.
Put the base "template" HTML in a memo field of a table and insert markers into
it. I use things like {Some_Data_Field_Name}. When constructing the EMail just
use several iterations of the Replace() function to insert your real data and
then stuff the result into the Email.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Lyle Fairfield - 10 Jun 2006 13:05 GMT
There is no substantive difference between an HTML string and any other
string. We call the one an HTML string because it contains HTML tags;
when this string is sent to a browser, the browser interprets these
tags and shows the results of wonderful tricks the instructions for
which are determined by the tag.
We can save the string as a file, or in a sufficiently large field. We
can retrieve the string and we can send that to an e-mail program. The
only difference between having the e-mail message rendered as HTML and
having it rendered in plain text is the instruction we give to the
e-mail program.
Almost all coding languages have a replace function which can be used
to modify any string, including an HTML string.
Larry Linson - 10 Jun 2006 19:50 GMT
> I need to convert the raw HTML
> into a text string, and that's the bit
> that takes the time because my
> client likes designing some pretty
> long emails loads of tables, font
> changes etc etc.
Help me understand: I have always been under the impression that "raw HTML"
_IS_ a text string.
Do you mean you need to find just the _content_ and extract it from the
formatting markup as a plain text string?
Larry Linson
Microsoft Access MVP
Dave G @ K2 - 14 Jun 2006 14:28 GMT
I'll try to explain - HTML is indeed a text string, but if you look at
a web page, then view source, then copy and paste the source into an
Access module and assign it to a string variable, then the mail program
fails. It fails because you need to take care of all the places where
quote marks are used in normal html
eg html may look like this: <table width="33">
assign that to a text variable s gives
s = "<table width="33">"
but to make it work you need
s = "<table width=""33"">"
Similarly:
s = "<font color=#" & "123456>"
OK, that's not too hard but with a lot of complex html it becomes a
real pain to have to go through it all and make the changes. I'm trying
to find an alternative method as what I'm given is a perfect finished
page of html.
Dave
> > I need to convert the raw HTML
> > into a text string, and that's the bit
[quoted text clipped - 11 lines]
> Larry Linson
> Microsoft Access MVP
Rick Brandt - 14 Jun 2006 14:37 GMT
> I'll try to explain - HTML is indeed a text string, but if you look at
> a web page, then view source, then copy and paste the source into an
[quoted text clipped - 8 lines]
> but to make it work you need
> s = "<table width=""33"">"
[snip]
You do not need to do this. I assign long HTML markup to string variables
all the time and I don't have to do anything about the quotes in the HTML.
If you are *building* the string in your code then you do have this issue,
but if you pull the HTML from a file or database record then it is not an
issue. Same is true of long complex SQL strings. If I pull them from a
database field then I don't have to worry about all of the usual quote
delimiting that would be required were I constructing the string inside the
code routine.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dave G @ K2 - 14 Jun 2006 16:24 GMT
Aha !!
I've just realised something - the html source I receive from the
designer has quote marks around every parameter eg <table width="33">.
I now discover that these quote marks are not needed. Apparently they
are good practice, but not essential. So if I get rid of all quote
marks withing the html then my problems are solved. Even better, the
designer is going to strip them all out for me - big sigh of relief.
Dave
> > I'll try to explain - HTML is indeed a text string, but if you look at
> > a web page, then view source, then copy and paste the source into an
[quoted text clipped - 23 lines]
> Email (as appropriate) to...
> RBrandt at Hunter dot com
Lyle Fairfield - 15 Jun 2006 00:02 GMT
> Aha !!
> I've just realised something - the html source I receive from the
[quoted text clipped - 3 lines]
> marks withing the html then my problems are solved. Even better, the
> designer is going to strip them all out for me - big sigh of relief.
How are they sent? If they are sent as files then certainly stripping
off quotation marks is unnecessary. In some cases quotation marks are
essential.
You can read the contents of a text file and assign it to a string
variable without worrying about quotation marks. Copying the string
from a View Source utility is inefficient.
Dave G @ K2 - 15 Jun 2006 09:51 GMT
They are sent as html files, straight out of Dreamweaver I believe. I
open them in a browser to see what they look like. Then I view the
source and copy and paste it to a module and start work on it. Anyway,
not to worry. I've got it all working fine now - so thanks to everyone
Dave
> > Aha !!
> > I've just realised something - the html source I receive from the
[quoted text clipped - 10 lines]
> variable without worrying about quotation marks. Copying the string
> from a View Source utility is inefficient.