append formatted text to postitem's body

S

sd

hello
I need to assign formatted text to postitem's body.I tried HtmlBody
prop of PostItem but I need to modify
existing HtmlBody to append my formatted text to it.I tried with
redemption.SafePostItem as it has RTFBody
prop.But when I append my formatted text to RTFBody prop of
SafePostItem,it is not reflected on postitem's
body.I'm using below code
' BttnAdd_Click()
ObjSafePostItem = CreateObject("Redemption.SafePostItem")
If ObjSafePostItem IsNot Nothing Then
ObjSafePostItem.item = CurrentPostItem
ObjSafePostItem.RtfBody += ctlTxtLog.Text +
ControlChars.NewLine 'ctlTxtLog -txtbox on customized post form
ObjSafePostItem = Nothing
ctlTxtLog.Text = ""
End If
how to add formatted text to postitem's body & get it reflected
immediately on form? I'm using OL 2007.

Thanks
 
S

Sue Mosher [MVP-Outlook]

You can't use RTF techniques on an HTML-format item or vice versa. Replace
the </body> tag in the HTML body string with your fully tagged HTML content
and a new </body> tag.
 
C

cainrandom

thanks sue

Is the HTML body available in the OOM in versions of Outlook earlier
than 2003? Also, be aware that inserting into the HTML body can be a
little iffy if the message is some kind of richly formatted (usually
commercial mass mailing) message. You'll probably want to test your
approach with a lot of messages with different kinds of HTML structure.
 
C

cainrandom

The MailItem.HTMLBody property was added in Outlook 98, the first versionto
support HTML message bodies.
--
Sue Mosher, Outlook MVP
   Author of Microsoft Outlook 2007 Programming:
     Jumpstart for Power Users and Administrators
   http://www.outlookcode.com/article.aspx?id=54

Thanks, Sue! I don't know much about the OOM, just MAPI.

One more thought, sd: if your HTML is at all complicated, consider
testing how it looks in Outlook 2007. Because it uses Word 2007 as
its default HTML renderer (and because Word 2007 understands HTML
about as well as IE4 with a fork in its eye), it may look wildly
different.
 

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