Getting formatted body from email to word

V

Vampyr_Bytes

Hi there,

I'm trying to get the body of html emails into a word document. I can get the
contents over as either plain text or html code, but cannot figure out how to
get it across formatted. The code I'm using is below. Any and all help is
greatly appreciated.

Sub SendToWord()

Dim objFolder As MAPIFolder
Dim objEmail As MailItem
Dim objDoc As Word.Document
Dim objWord As Word.Application
Dim Count As Integer
Dim i As Integer


'Getting outlook inbox folder
Set objFolder = Application.ActiveExplorer.CurrentFolder

'Total number of mails in the inbox
Count = objFolder.Items.Count
Set objWord = CreateObject("Word.Application")
objWord.Visible = True

Set objDoc = objWord.Documents.Add
objDoc.Activate

i = 0
While i < Count
i = i + 1
With objFolder.Items(i)
objWord.Selection.TypeText .Body
objWord.Application.Run ("GetDetails")
End With
Wend
objWord.Quit savechanges:=False


End Sub

That gives the plain text. If I use objWord.Selection.TypeText .HTMLBody I
get the html code.

Thanks in advance
 
M

Michael Bauer

Am Thu, 15 Dec 2005 19:51:30 GMT schrieb Vampyr_Bytes:

You can save the HTMLsource as a file and open that one in Word.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top