Import and export *.msg (Outlook Message Format) through VBA

  • Thread starter Thread starter Anthony Yio
  • Start date Start date
A

Anthony Yio

Hello,


In Ms Outlook, I can save my Task, Calendar, Contact, Note to a *.msg
file respectively. And then, through drag and drop, I can drag the *.msg
file back to the Ms Outlook Malibox (*.pst).

My question is, how do I through VBA save my task, calendar, note,
contact item from *.pst to files? And then, through VBA again, load back my
files back to the select *.pst.

thank you


Regards,
Anthony Yio
 
You can easily save those items in code as MSG files by using the SaveAs
method with a type of olMSG. However, Outlook's object model doesn't have
methods to open a MSG file as the original item type. A 3rd party library,
Redemption (www.dimastr.com/redemption) does have that ability in its
MAPIUtils.GetItemFromMsgFile method.
 
Or you can import the MSG file back into an existing Outlook item using
Safe*Item.Import in Redemption.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top