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

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
 
D

Dmitry Streblechenko

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
-
 
C

cainrandom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top