0

I need to "SaveAs" a list of emails to html including colorshememapping.xml, filelist.xml, and themedata.thmx files?

If I "SaveAs" html manually one by one from Outlook to a specified shared folder, there are separate folders with 3 files (colorshememapping.xml, filelist.xml, and themedata.thmx) created on top of the "Email subject.htm".

The above manual step is different from below macro in Excel VBA that just changes the .msg to .htm.

How can I SaveAs a list of emails to htm format like I have done manually in Outlook.

There is another limitation. I cannot use Application.ActiveInspector due to security set by my company.

Sub Chgext()
ThisWorkbook.Activate
Sheets("RM response").Select
strSourceDirectory = Range("B1").Value
    
strSourceFile = Dir(strSourceDirectory & "*.msg")

Do While strSourceFile <> ""
    Name strSourceDirectory & strSourceFile As strSourceDirectory & 
    Replace$(strSourceFile, ".msg", ".htm")
    c = c + 1
    strSourceFile = Dir()
Loop

End Sub
Community
  • 1
  • 1
jun
  • 21
  • 2
  • For future searchers. Appears you initially asked the wrong question . [Save email msg as htm](https://stackoverflow.com/questions/68077405/save-email-msg-as-htm) shows you know the answer. – niton Jun 25 '21 at 17:11
  • Thank you very much. I have tried the above script. Although it will change the extension from msg to htm, it is missing separate folders with 3 files (colorshememapping.xml, filelist.xml, and themedata.thmx). If there folders are not generated, the email will not be read as pdf format. Hope I could get more guidance here. Many thanks again. – jun Jun 26 '21 at 10:05

0 Answers0