|
-
September 20th, 2001, 07:26 AM
#5
Re: E-mail
Hi, if you want only the list of message it there in the code sample.
but if you want to read a particular message
try using the following code sample!
I haven't tried it. but got form MSDN!
void Save_Message_to_File(IMessagePtr iMsg, bstr_t filename)
{
/*
** This example shows a common use of the ADO Stream
** object with CDO, namely, saving a serialized
** message to disk using an ADO Stream object.
**/
_StreamPtr pStm(__uuidof(Stream));
IDataSourcePtr iDsrc;
iDsrc = iMsg;
_variant_t varOptional(DISP_E_PARAMNOTFOUND,VT_ERROR);
pStm->raw_Open(
varOptional,
adModeUnknown,
adOpenStreamUnspecified,
NULL,
NULL);
pStm->Type = adTypeText;
pStm->Charset = "US-ASCII"; // apparently, we need this!
try
{
iDsrc->SaveToObject(pStm,_bstr_t("_Stream"));
}
catch(_com_error error)
{
throw error;
}
try {
pStm->SaveToFile(filename,adSaveCreateOverWrite);
}
catch(_com_error e)
{
throw e;
}
}
Hope this helps!
-Amudhan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|