How to work with mail items in outlook 2003(C++)

  • Thread starter Thread starter Roman
  • Start date Start date
R

Roman

Hi,
I am very new in C++ and working on Add-in for outlook 2003.
Can anyone adviced me how to extract attachments from mail which linked to
other mail
(user create new mail "MAIL1" and insert item for example "MAIL2"mail with
attachments "ATTACH1" and "ATTACH2" from inbox folder)

On some event I recieve attachment list for MAIL1
MyMethod((LPDISPATCH pMailItem...)
{
....
hr = GetProperty(pMailItem, L"Attachments", &vtAttachments); // I recieve
"MAIL2"

but how extract attachments from this "MAIL2" ?
Can anyone help?

Thanks in advance
 
The best you can do in the Outlook Obejct Model (the other alternatives are
Extended MAPI or Redemption) is to check teh Attachment.Type property, and
if it is olEmbeddeditem (5), call Attachmeent.SaveAsFile.
You can then reopen the resulting MSG file using Namespace.OpenSharedItem
(OUtlook 2007 specific) or use Application.CreateItemfromTemplate (it will
wipe out all the sender related data).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
The best you can do in the Outlook Obejct Model (the other alternatives are
Extended MAPI or Redemption) is to check teh Attachment.Type property, and
if it is olEmbeddeditem (5), call Attachmeent.SaveAsFile.
You can then reopen the resulting MSG file using Namespace.OpenSharedItem
(OUtlook 2007 specific) or use Application.CreateItemfromTemplate (it will
wipe out all the sender related data).

Alternatively, look into Redemption. If you want more power than the
OOM offers but don't want to make your eyes bleed, it's a fantastic
way to get stuff done.
 
Back
Top