ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Picking up E-Mail Details (https://www.excelbanter.com/excel-programming/335632-picking-up-e-mail-details.html)

Teresa

Picking up E-Mail Details
 
Hi,

I'm trying to write a macro within a spreadsheet which picks up details
whenever a mail is sent to any of my Folders (Microsoft Outlook)

So my Columns a

From Subject Time

Thanks

Gareth[_6_]

Picking up E-Mail Details
 
I suggest this would be easier to approach by placing code within
Outlook to trap new email, updating the spreadsheet on that event.
Trying to control Outlook from Excel is feasible but fraught with
problems due to the security messages every ten minutes or so when you
access the mail properties etc.

To start you off, I would go into Outlook's VBE and look at the NewMail
event. You need something like the below in the ThisOutlookSession module.

Sub Application_NewMail()

'Go through each new message
'Write details to Excel
'Loop

End Sub

This would probably be more appropriate for the Outlook VBA newsgroup:
microsoft.public.outlook.program_vba

You may find this useful too
http://msdn.microsoft.com/library/de...pplication.asp

With respect to the updating Excel part of your code. This can be
achieved by accessing Excel through OLE, opening your workbook (if not
open) and writing the required data. However, if you don't need
formatting of the worksheet, I would recommend writing to a CSV file
directly from Outlook. This is far simpler, quicker and can still be
easily opened in Excel.

HTH,
Gareth



teresa wrote:
Hi,

I'm trying to write a macro within a spreadsheet which picks up details
whenever a mail is sent to any of my Folders (Microsoft Outlook)

So my Columns a

From Subject Time

Thanks



All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com