Import data from a Outlook mail in excel

  • Thread starter Thread starter Stift
  • Start date Start date
S

Stift

Hi ,I'm new to this forum,and am not very good in VBA.I'll explain m
problem:

Every Friday I'll get a mail from someone with a few numbers.
He uses a standard lay-out for it and looks like :

Hi here the numbers of week 17
seacontainers : 5
storagecontainers : 15

Now I every week copy these numbers and put them in a excel-
file. :(
Is there a possibillity to automate this???
What do I have to do?


Thanks in advance!


Stif
 
Owwk, I understand the code. It need some adjustments but I think that
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 actio
automattically(so I don't need a button)!

Hope you can help m
 
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.
 

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

Back
Top