Koekiebox
Koekiebox

Reputation: 5963

Visual Basic 6: Read MSG files and extract content

I would like to read MSG file stored on the filesystem and do the following:

Is it possible using the msoutl.olb#Microsoft Outlook 10.0 Object Library?

I would like to avoid using Outlook Redemption v. 4.7 based on question MSG Read Stackoverflow question

Thank you.

Upvotes: 2

Views: 5989

Answers (1)

C-Pound Guru
C-Pound Guru

Reputation: 16368

I believe you can. Try adding a reference to the Outlook 10 object library and then try this code:

Dim OL As Outlook.Application
Dim Msg As Outlook.MailItem
Set OL = New Outlook.Application
Set Msg = OL.CreateItemFromTemplate("c:\msg.msg")
' now use msg to get at the email parts
MsgBox Msg.Subject
Set OL = Nothing
Set Msg = Nothing

I can't vouch for any of the methods or properties of your Outlook.MailItem object (msg) but give it a shot and see.

Upvotes: 4

Related Questions