Help!

Append text to (formatted) body of Reply

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  Contact Lists and Importing  
Author Message
Mark Parent
External


Since: Mar 07, 2007
Posts: 5



PostPosted: Thu Sep 10, 2009 1:39 pm    Post subject: Append text to (formatted) body of Reply
Archived from groups: microsoft>public>outlook>program_vba (more info?)

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?
Back to top
Dmitry Streblechenko
External


Since: Nov 23, 2003
Posts: 1401



PostPosted: Thu Sep 10, 2009 2:26 pm    Post subject: Re: Append text to (formatted) body of Reply [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
-
"Mark Parent" <MarkParent.DeleteThis@discussions.microsoft.com> wrote in message
news:42CCACDB-6612-4201-BE11-76D32AD2B6DA@microsoft.com...
> 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?
>
>
Back to top
Mark Parent
External


Since: Mar 07, 2007
Posts: 5



PostPosted: Fri Sep 11, 2009 8:22 am    Post subject: Re: Append text to (formatted) body of Reply [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

On a side note, let me thank all of the responders to these discussions...
This board is an incredibly practical resource!


"Dmitry Streblechenko" wrote:

> 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
> -
> "Mark Parent" <MarkParent.TakeThisOut@discussions.microsoft.com> wrote in message
> news:42CCACDB-6612-4201-BE11-76D32AD2B6DA@microsoft.com...
> > 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?
> >
> >
>
>
>
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum