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
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!