Created
December 11, 2012 22:36
-
-
Save mrowles/4262972 to your computer and use it in GitHub Desktop.
Microsoft Outlook: Create a new email message from an HTML file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub CreateHTMLMsg() | |
Dim sLocation As String | |
'Change this to the location of your HTML file | |
sLocation = "C:\HTML_Template.html" | |
Set objMsg = Application.CreateItem(olMailItem) | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set ts = fso.OpenTextFile(sLocation, 1) | |
strText = ts.ReadAll | |
objMsg.HTMLBody = strText | |
objMsg.Display | |
'Clear memory | |
Set fso = Nothing | |
Set ts = Nothing | |
Set objMsg = Nothing | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment