BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem reading PR_BODY in Outlook 2003

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language)
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed May 03, 2006 11:14 pm    Post subject: Problem reading PR_BODY in Outlook 2003 Reply with quote



I have used Extended MAPI to read a Message Body (plain text)
succcessfully in Microsoft Outlook 2000 and 2002 using C++ Builder:

char *bodybuf=0;
unsigned int bodysize=0;
IStream *istream;
hr = imsg->OpenProperty(PR_BODY, &IID_IStream, STGM_READ, 0,
(IUnknown**)&istream);
if (hr==S_OK)
{
STATSTG stg = {0};
hr = istream->Stat(&stg,STATFLAG_NONAME);
if (hr==S_OK)
{
bodysize = stg.cbSize.LowPart;
bodybuf = new char[bodysize+1];
ULONG red;
hr = istream->Read(bodybuf, bodysize, &red);
if (hr!=S_OK)
bodysize=0;
else if (red<bodysize)
bodysize=red;
bodybuf[bodysize]=0;
}
istream->Release();



}


But the problem happens when I read a message in Microsoft Outlook
2003: body lines are wrapped at no more than 70 characters per line
with phisical \r\n which are not present in the message body if I open
the message and copy its body and paste it in the notepad. I read the
same message in Outlook 2002 and the plain text is correct, without
these extra \r\n. I guess it could be a parameter to get the message's
plain text without any wrap.

I have tried reading PR_BODY_HTML and it does not contain the \r\n but
I am interested in the plain text, and I wouldn't like to remove all
HTML tags.


Any idea?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.