BUG: HTMLBody Modified by OnOpenComplete Is Not Formatted When Viewed Over SMTP (293611)



The information in this article applies to:

  • Microsoft Outlook 2000, Service Release 1 (SR-1)

This article was previously published under Q293611

SYMPTOMS

When you use an Exchange Client Extension to modify the HTMLBody property of a mail message during the OnOpenComplete event, the text from HTMLBody may not be formatted when viewed from Outlook by way of SMTP. If the message is closed and then reopened, however, the text may then appear formatted.

Depending on how the message is sent, the symptoms may vary. For example, the text from HTMLBody may show up formatted the first time and not the second time.

RESOLUTION

In the code of the Exchange Client Extension, replace the Body property of the mail message with a Null terminated empty string; for example:
MailItem->Body = "\0"; // NULL terminate the body.
MailItem->HTMLBody = "<HTML><BODY><H1><font color=silver size=20>This is the body</font></H1></BODY></HTML>";
MailItem->Save();
				

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create an extension that implements the OnOpenComplete event.
  2. In the event, use the Outlook Object Model to change the HTMLBody property of the message that caused the event to fire.
  3. Register the extension.
  4. Start Outlook using a profile that is connected by SMTP.
  5. Open a mail item and your event should fire.
  6. You will see your text from the HTMLBody property, but it is not HTML-formatted.

Modification Type:MinorLast Reviewed:3/4/2004
Keywords:kbbug kbMsg kbOutlookObj kbpending KB293611