Copy Body of Message to Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

First my apologies: I'm rather new at Outlook programming.

Could someone provide me with some instruction as to how I would copy the
body of an email message and paste it into the first empty row of excel via
an outlook macro?

Thanks for the help!
 
Hi,

it works without using the clipboard, (OL VBA) sample for one selected
MailItem in the Inbox:

Dim xlApp as Excel.Application
Dim oWs as Excel.Worksheet
Set xlApp=New Excel.Application
Set oWs=xlApp.Workbooks.Add.Worksheets(1)
oWs.Cells(1,1).Value=Application.ActiveExplorer.Selection(1).Body

For opening an existing Workbook please see the ObjectBrowser,
Workbooks.Open method and press F1 for more help and code samples.
 
Hi Michael, thanks for the help.

I'm getting the compile error "user defined-type not defined" on the row

Dim xlApp as Excel.Application

How can I correct this?
 
Back
Top