I now want to use the content as an Outlook template and want to know the
best way of converting the content into an Outlook .OFT format. I have tried
to cut/paste with no luck and can not work out how to access the code view
of the object.
- Puzzled!
Sub MakeHTMLMsg()
Set objMsg = Application.CreateItem(olMailItem)
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("c:\testfile.htm", 1)
strText = ts.ReadAll
objMsg.HTMLBody = strText
objMsg.Display
Set fso = Nothing
Set ts = Nothing
Set objMsg = Nothing
End Sub
Once you have the message displayed you can use the Save As command to save it as an .oft file.
Note, however, that your HTML may or may not be suitable for an email message. You should to test it thoroughly with a variety of receiving email applications.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"Mark" <mark_...@hotmail.com> wrote in message news:CB924E9C-FABA-4AA9...@microsoft.com...