Darrell Burns
dhb at flsi.com
Wed Aug 31 16:13:58 CDT 2011
Thanx, Bill. I was able to get a list of my accounts. Do you know what the property is for the Default account? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Benson (VBACreations.Com) Sent: Wednesday, August 31, 2011 11:56 AM To: 'Access Developers discussion and problem solving' Subject: [Spam]8.51 Re: [AccessD] [Spam]8.51 Re: Get sender's eMail address This works from Access with a reference to Outlook only... Note I have a pst folder called GMAIL and I am searching Inbox... change to suit. Dim myOlApp As Object Dim myNameSpace As Object Dim myfolders As Object Dim MyFolder As Object Dim myfolder2 As Object Dim item As Object Dim n As Long Set myOlApp = CreateObject("Outlook.Application") Set myNameSpace = myOlApp.GetNamespace("MAPI") Set myfolders = myNameSpace.Folders n = 1 Do Until UCase(myfolders.item(n).Name) = "GMAIL" n = n + 1 Loop Set MyFolder = myfolders.item(n) Set myfolder2 = MyFolder.Folders("Inbox") For Each item In myfolder2.Items If item.Class = 43 Then Debug.Print item.SenderEmailAddress End If Next item End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com