Re: losing mail body content after close event of mailItem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance





Where does your code run? Disappears the text only after sending the
message?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Tue, 21 Aug 2007 09:36:02 -0700 schrieb nana:

I have just tried what you suggest. It doesn't work, the text is still
disappearing. Could there be any settings in the exchange server that is
causing this behavior?


"Michael Bauer [MVP - Outlook]" wrote:



MailItem.HTMLBody="hallo"
MailItem.Save

should do it. If you don't display an item then you don't need to close
it.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Fri, 17 Aug 2007 08:30:06 -0700 schrieb nana:

Hello,
I have a mail item and I tried to add some text to this mail item by the
following code
OutLookApplication = new ActiveXObject("Outlook.Application");
MailItem =
OutLookApplication.GetNamespace("MAPI").GetItemFromID(ItemID);
MailItem.HTMLBody = "<HTML><HEAD></HEAD>
<BODY>HELLO</BODY></HTML>";
MailItem.Close(olSave);

After calling the MailItem.Close(olSave) method, the mail body has been
converted
to the following

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

</BODY>
</HTML>


and my text is gone, any idea? I have tried manually do the saving by
calling MailItem.Save and MailItem.Close(1), but this also doesn't work

.



Relevant Pages