So you really need to merge two HTML strings into one. You can either create
an instance of the IHTMLDocument2 object, load your data, then modify the
HTML (insert other HTML strings, etc) using DOM.
Or, if you simply need to insert an HTML substring at the very beginning
1. Find the position of the "body" substring
2. Find the position of the next "" character (this is needed to skip over
the body attributes)
3. Insert new HTML at that position + 1.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"grahamproctor" wrote in message
...
Thanks again, Dmitri.
What I am trying to achieve is having a graphic at the top of the email
body, immediately followed by text which has been customised with
different fields from a database, dependent on the recipient and other
parameters.
The uncustomised text is currently stored in a .htm and I have
successfully customised this HTML in code, before putting it into the
HTML.Body. So conceptually, I am trying to append that HTML text to the
graphic already in the body of the email.
I tried before to have the graphic in the .htm but that was
unsuccessful because the graphic just turned into a placeholder when it
reached Outlook. Funnily enough, the graphic did appear in the untitled
email when it was displayed from code but when I sent or saved it, the
graphic disappeared when it was in the Outbox.
I tried your other trick to make the graphic a watermark/background in
the body and that worked fine, except for sizing issues but that still
left me with the problem of how to append the HTML text to the
HTML.Body without replacing the graphic which was already successfully
placed there.
I suppose I could try to combine the graphic and text into a .jpg in
code and then use your trick but how I would do that I have no idea.
Puzzling? Not for you!!!
All the best, Graham.
--
grahamproctor
------------------------------------------------------------------------
grahamproctor's Profile: http://www.officehelp.in/member.php?userid=6171
View this thread: http://www.officehelp.in/showthread.php?t=1325714
Posted from - http://www.officehelp.in