PDA

View Full Version : [SOLVED:] Export whole Outlook email to excel



ansonau712
08-20-2018, 04:01 AM
hi all,

I am working on export some emails from outlook to excel. Somehow the email body export to excel is one cell and I cannot use the split function to separate those text to column (since after export, spaces between text are gone, and all the text was combined.and lose the format of table.). I also tried using the HTML table nature but somehow it is classified as one cell..


Is there a way to simulate the manual action like opening the excel and highlight all context in body, and paste it to excel? I manually do this and all the format is good.

Appreciated.

gmayor
08-20-2018, 05:20 AM
Maybe something lke


Dim olMsg As Outlook.MailItem
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
Set olMsg = ActiveExplorer.Selection.item(1)
With olMsg
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range
.Display
oRng.Copy
End With

ansonau712
08-21-2018, 12:15 AM
thx! it works perfectly