Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook msg won't save as html or rtf only text

Status
Not open for further replies.

nickmck

Technical User
Mar 7, 2015
1
GB
HI I want to save a .msg file to html, I use Outlook 2010, If I open the message and save as html though Outlook it works absolutely fine but when I try to save a message to html or even rtf through vbscript is refuses to save as anything other than text, I have tried various different ways but with no joy:

Set olapp = CreateObject("outlook.application")
Set oNamespace = olapp.application.GetNamespace("MAPI")
Set oItem = oNamespace.OpenSharedItem("C:\1.msg")

oItem.SaveAs "c:\1.html", olhtml
oItem.Close olDiscard
Set oItem = Nothing
Set oNamespace = Nothing

I Have tried createfromtemplate not using MAPI
A host of different ways but nothing seems to work

Any help would be much appreciated THANKS

 
You have to define the value of the constants:
olHtml = 5
olDiscard = 1

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top