fredmartinmaine
IS-IT--Management
I have a need - using vbscript - to create an Outlook object and open a message currently stored in an .msg file.
Spent a lot of time on the web trying to find out how to do this and although you'd think you could just create an Outloook Message object and open it in there, it seems to be a lot more complex.
Did a lot of poking around to discover the OpenSharedItem method:
objOutlook = CreateObject("Outlook.Application")
set oNamespace = objOutlook.GetNamespace("MAPI")
oNamespace.OpenSharedItem("H:\Projects\Assigned-Risk.msg")
This runs without error but I can't get beyond this. oNamespace seems to hold the email message, or pointers to it at least, but I haven't the slightest idea of how to stuff it into an email message, or read it in any other way.
What I'm really trying to do is save that .msg file as an .mht (html) file, which if I manually open the .msg with Outlook, I can easily do with "save as". I'm just trying to automate that process. User picks an .msg file, and the script saves it as an .mht.
Thanks in advance for any help,
Fred
Spent a lot of time on the web trying to find out how to do this and although you'd think you could just create an Outloook Message object and open it in there, it seems to be a lot more complex.
Did a lot of poking around to discover the OpenSharedItem method:
objOutlook = CreateObject("Outlook.Application")
set oNamespace = objOutlook.GetNamespace("MAPI")
oNamespace.OpenSharedItem("H:\Projects\Assigned-Risk.msg")
This runs without error but I can't get beyond this. oNamespace seems to hold the email message, or pointers to it at least, but I haven't the slightest idea of how to stuff it into an email message, or read it in any other way.
What I'm really trying to do is save that .msg file as an .mht (html) file, which if I manually open the .msg with Outlook, I can easily do with "save as". I'm just trying to automate that process. User picks an .msg file, and the script saves it as an .mht.
Thanks in advance for any help,
Fred