export figure from Outlook msg to Excel

M

Max Bialystock

I'd like to be able to use a macro in Outlook 2003 to find "Total sales" in
the current mail item and export the result to A1 in an Excel spreadsheet.

I think it's possible, but I don't know how to do it.

The following day I would run the macro again and export the result to A2 in
the same spreadsheet.

If anyone can assist at all, I'll be very grateful indeed.
 
M

Michael Bauer [MVP - Outlook]

You can search strings in the mail with the Instr function, and extract them
e.g. with Left, Right, and Mid.

Add a reference to Excel to your Outlook project via Tools/References. This
opens a workbook:

Dim xl As Excel.Application
dim wb as Excel.Workbook
Dim ws as Excel.Worksheet
Dim rn as Excel.Range

Set xl=new Excel.Application
Set wb=xl.Workbooks.Open("file")
Set ws=wb.sheets(1)
Set rn=ws.Range("A1")

rn.Value = "hello"


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Sat, 21 Apr 2007 16:29:14 +1000 schrieb Max Bialystock:
 
Top