Opening an Outlook .MSG file that’s on my hard drive

1132395 pts.
Tags:
.MSG File
hard drive
Microsoft Outlook
Does anyone know of a way to open an Outlook .MSG file that's on my hard drive but not in Outlook? I already have a code that loops through file names in a folder on my hard drive but I'm not sure of the path on how to open it with Outlook. Here's what I have so far:
Dim inPath as String
Dim thisFile as String
Dim msg as MailItem
Dim OlApp as Object
Set OlApp = CreateObject("Outlook.Application")
inPath = "C:temp"

thisFile = Dir(inPath & "*.msg")
Do While thisFile <> ""
    'At this point, thisFile contains the path of a .msg like "C:tempmail_item1.msg"
    'msg =  <~~~~ HELP HERE
    'Do stuff with msg

    thisFile = Dir
Loop
Any help would be appreciated. Thanks!
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,
You should try this:

Sub CreateFromTemplate()
Dim MyItem As Outlook.MailItem
Set MyItem =
Application.CreateItemFromTemplate("C:\temp\mail_item1.msg")
MyItem.Display
End Sub

For more info click here: Application.CreateItemFromTemplate Method (Outlook).

I hope it will assist you in resolving issues.

Thanks & Regards,

Clark Kent

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: