View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default Import data from a Outlook mail in excel

Stift

Put the code in a standard module. Alt-F11 to open the VBE. Right click on
your project in the Project Explorer Window and choose Insert - Module.
Make sure you set a reference to the Outlook object library.

To get the code to run whenever the workbook is opened, call your sub from
the Workbook_Open event. In the VBE, find the ThisWorkbook module under
your project and double click it. From the drop down boxes at the top of
the ThisWorkbook module, choose Workbook (from the left) and Open (from the
right). The VBE will put the Sub and End Sub statements in the code pane.
If you macro (in the standard module) is named GetOutlookMail, then the
Workbook_Open macro will look like

Private Sub Workbook_Open()

GetOutlookMail

End Sub

If you'd rather have a button, then show the Forms toolbar in Excel and drag
a command button on to the sheet. Right click the button and choose Assign
macro and point to GetOutlookMail.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Stift " wrote in message
...
Owwk, I understand the code. It need some adjustments but I think that I
can fix that.

Problem is more.Where do I have to set te code ?

I want that when I open the excelfile, he will perform this action
automattically(so I don't need a button)!

Hope you can help me


---
Message posted from http://www.ExcelForum.com/