There is no HTMLBody property because that type of item doesn't support
HTML. You can only provide formatting using RTF (Rich Text format) and
provide it in the PR_RTF_COMPRESSED property, which is a binary property
(you'd write to it as an array of hex coded bytes). The DASL property tag
for PR_RTF_COMPRESSED is
"http://schemas.microsoft.com/mapi/proptag/0x10090102".
You would have to create syntactically correct RTF text and write it to that
property. You may want to re-think your efforts, RTF is a real beast to work
with. Also, in Outlook 2007 the PropertyAccessor will be able to write that
property but won't be able to read it if the contents of the property are
larger than about 8 KB.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"musa.biralo" <***@gmail.com> wrote in message news:a7e76c13-d567-45bf-b70f-***@37g2000yqm.googlegroups.com...
Looks like this is the only method.... but i am stuck at another
simple issue :(
Dim appointmentItem As Outlook.AppointmentItem =
Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olAppointmentItem)
CopyEmailBodyToAppointmentBody(selectedMail, appointmentItem)
'--------------------
Private Function CopyEmailBodyToAppointmentBody(ByVal email As
Microsoft.Office.Interop.Outlook.MailItem, _
ByVal appointment As
Microsoft.Office.Interop.Outlook.AppointmentItem) As Boolean
If email Is Nothing OrElse appointment Is Nothing Then
Return False
End If
Try
Dim emailWordDocument As Microsoft.Office.Interop.Word.Document
= email.GetInspector.WordEditor
Dim emailWordSelection As
Microsoft.Office.Interop.Word.Selection =
emailWordDocument.Windows(1).Selection
Dim appointmentWordDocument As
Microsoft.Office.Interop.Word.Document =
appointment.GetInspector.WordEditor
Dim appointmentWordSelection As
Microsoft.Office.Interop.Word.Selection =
emailWordDocument.Windows(1).Selection
emailWordSelection.WholeStory()
emailWordSelection.Copy()
appointmentWordSelection.PasteAndFormat(Microsoft.Office.Interop.Word.WdRecoveryType.wdPasteDefault)
'<---- Error
' Error = This method or property is not available because the
document is locked for editing.
' I am clueless on resolving this. What do I need to do to
resolve this? Thanks.
Catch ex As Exception
Return False
End Try
Return True
End Function
Original Source Code : http://www.outlookcode.com/codedetail.aspx?id=2040
Thanks for your help.
Musa.
Post by musa.biraloHi,
I am trying to create a formatted appointment body but the only method
I can see in the appointmentItem is body. This method only writes the
plain text not the formatted html body.
what i simply like to do is
appointmentItem.HTMLBody = emailItem.HTMLBody
but the HTMLBody is not availabe under AppointmentItem :(
So, what is the approach of formatting an appointment body?
Thank you.