A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Unable to create HTML mail message(Unicode) using MAPI in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 30th 08, 10:52 PM posted to microsoft.public.outlook.program_forms
UTEK
external usenet poster
 
Posts: 1
Default Unable to create HTML mail message(Unicode) using MAPI in Outlook

have this chunk of code that creates an email body in outlook . If it is
regular text, it uses the PR_BODY_W property; if it is html format, then it
uses 0x1013001F(PR_BODY_HTML_W).

if (fishtml)
{
SPropValue vals;
SPropProblemArray *lpprob;
memset(&vals, 0, sizeof(SPropValue));
//vals.ulPropTag = PR_STORE_SUPPORT_MASK;
vals.ulPropTag = PR_MSG_STATUS;
vals.Value.l = 0x80000000;
hr = mapiprop-SetProps(1, &vals, &lpprob);
}

hr = mapiprop-OpenProperty((fishtml?0x1013001F:PR_BODY_W), &IID_IStream, 0,
MAPI_MODIFY|MAPI_CREATE, (IUnknown**)&lpistream);

if (SUCCEEDED(hr))
{
ULONG cnt = (::SysStringLen(bsbody)+1) * sizeof(wchar_t);
ULONG cntwritten = 0;
lpistream-Write(bsbody, cnt, &cntwritten);
fsetbody = TRUE;
}


This works perfect in Outlook 2003. However, in Outlook 2007, the HTML mail
message always comes up blank while PR_BODY_W is fine.

I have also tried setting the PR_MSG_STATUS to
0x80000000(MSGSTATUS_HAS_PR_BODY_HTML
) , but it doesn't help. Any suugestions is greatly appreciated! Thank you
very much.
  #2  
Old January 2nd 09, 08:46 PM posted to microsoft.public.outlook.program_forms
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Unable to create HTML mail message(Unicode) using MAPI in Outlook

Does the message in question actually the HTML body? What do you see in
MFCMAPI or OutlookSpy?
What error code does OpenProperty() return?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"UTEK" wrote in message
...
have this chunk of code that creates an email body in outlook . If it is
regular text, it uses the PR_BODY_W property; if it is html format, then
it
uses 0x1013001F(PR_BODY_HTML_W).

if (fishtml)
{
SPropValue vals;
SPropProblemArray *lpprob;
memset(&vals, 0, sizeof(SPropValue));
//vals.ulPropTag = PR_STORE_SUPPORT_MASK;
vals.ulPropTag = PR_MSG_STATUS;
vals.Value.l = 0x80000000;
hr = mapiprop-SetProps(1, &vals, &lpprob);
}

hr = mapiprop-OpenProperty((fishtml?0x1013001F:PR_BODY_W), &IID_IStream,
0,
MAPI_MODIFY|MAPI_CREATE, (IUnknown**)&lpistream);

if (SUCCEEDED(hr))
{
ULONG cnt = (::SysStringLen(bsbody)+1) * sizeof(wchar_t);
ULONG cntwritten = 0;
lpistream-Write(bsbody, cnt, &cntwritten);
fsetbody = TRUE;
}


This works perfect in Outlook 2003. However, in Outlook 2007, the HTML
mail
message always comes up blank while PR_BODY_W is fine.

I have also tried setting the PR_MSG_STATUS to
0x80000000(MSGSTATUS_HAS_PR_BODY_HTML
) , but it doesn't help. Any suugestions is greatly appreciated! Thank
you
very much.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create an HTML email message? Margaret Bartley Outlook - General Queries 4 September 6th 08 01:54 AM
How to create mail item in OL 2007 using MAPI Ivan Add-ins for Outlook 4 October 23rd 07 09:18 AM
RTF my default; button to create HTML message directly? StargateFanFromWork Outlook - General Queries 7 May 10th 07 08:28 PM
Displaying Unicode characters in MAPI Address Book [email protected] Outlook - General Queries 1 December 20th 06 10:23 PM
Extracting Unicode MAPI properties using CDO Bertin Colpron Outlook - Using Forms 0 May 8th 06 04:28 PM


All times are GMT +1. The time now is 11:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.