Microsoft KB Archive/293611

= BUG: HTMLBody Modified by OnOpenComplete Is Not Formatted When Viewed Over SMTP =

Article ID: 293611

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Outlook 2000 Service Pack 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 = &quot;\0&quot;; // NULL terminate the body. MailItem->HTMLBody = &quot;This is the body &quot;; MailItem->Save;



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



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.

Keywords: kbbug kbmsg kboutlookobj kbpending KB293611

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.