Append text to (formatted) body of Reply

M

Mark Parent

My VBA code is properly finding and opening emails that I want to reply to,
but the body of these messages is formatted somewhat with a table and some
bordering.

I want to append some text to the bottom of this outgoing reply via my code,
but using objItm.Body = objItm.Body & chr(13) & newstring
seems to be removing all the formatting. I can send the reply (with its
formatting) just fine when I manually add text to the bottom, but I can't
seem to replicate this through my code. If can understand the line above
concatenating newstring might be forcing the body to text; is there a coding
way to position the cursor after the existing text and add text without
affecting the existing formatting?
 
D

Dmitry Streblechenko

You woudl need to set the HTMLBody propretty instead of Body.
Read the old value of HTMLBody, find the position of the "</body", inset
your own value just before that, set the new value of HTMLBody

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
M

Mark Parent

Thank You Dmitry... That's put me on the right track, and I've been able to
produce a much better looking outgoing email.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top