![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have the following code:
Private Sub myOlApp_InboxItems() Dim myOlApp As Outlook.Application Dim myfolder As Outlook.MAPIFolder Dim myitems As Items Dim mynamespace As NameSpace Dim n As Integer Set myOlApp = CreateObject("Outlook.Application") Set mynamespace = myOlApp.GetNamespace("MAPI") Set myfolder = mynamespace.GetDefaultFolder(olFolderInbox) Set myitems = myfolder.Items MsgBox myitems.Count n = 1 MsgBox myitems(n) 'this gives me the subject of the 1st e-mail in my inbox End Sub From this I can loop and see the subject of each e-mail in my inbox. What I would like to see is the e-mail address of the sender and the date it was sent. Any ideas how I can code this? Thanks, Stanley |
Ads |
#2
|
|||
|
|||
![]()
I did this and its works fine except I can't get the SenderEmailAddress (it
is not there). I can get "ReceivedTime" and "SenderName". I am using Outlook 2002. Any ideas? Thanks, Stanley "Ken Slovak - [MVP - Outlook]" wrote: Instantiate an Outlook.MailItem from that myitems(n). Then read any properties you want from the MailItem such as ReceivedTime or SenderEmailAddress. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Stanley" wrote in message ... I have the following code: Private Sub myOlApp_InboxItems() Dim myOlApp As Outlook.Application Dim myfolder As Outlook.MAPIFolder Dim myitems As Items Dim mynamespace As NameSpace Dim n As Integer Set myOlApp = CreateObject("Outlook.Application") Set mynamespace = myOlApp.GetNamespace("MAPI") Set myfolder = mynamespace.GetDefaultFolder(olFolderInbox) Set myitems = myfolder.Items MsgBox myitems.Count n = 1 MsgBox myitems(n) 'this gives me the subject of the 1st e-mail in my inbox End Sub From this I can loop and see the subject of each e-mail in my inbox. What I would like to see is the e-mail address of the sender and the date it was sent. Any ideas how I can code this? Thanks, Stanley . |
#3
|
|||
|
|||
![]()
SenderEmailAddress was added in Outlook 2003. A hack workaround would be to
create a reply and get the address from that: Dim oReply As Outlook.MailItem Set oReply = oMail.Reply strAddress = oReply.Recipients.Item(1).Address oReply.Close olDiscard -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Stanley" wrote in message ... I did this and its works fine except I can't get the SenderEmailAddress (it is not there). I can get "ReceivedTime" and "SenderName". I am using Outlook 2002. Any ideas? Thanks, Stanley |
#4
|
|||
|
|||
![]()
This worked out OK. except when I tried to get an email sender from our own
email server i got /O=ZONI GROUP/OU=FIRST ADMINISTRATIVEGROUP/CN=RECIPIENTS/CN=STANLEY. I tried this is Outlook 2003 and and got the same result using SenderEMailAddress. Any ideas, Thanks, Stanley "Ken Slovak - [MVP - Outlook]" wrote: SenderEmailAddress was added in Outlook 2003. A hack workaround would be to create a reply and get the address from that: Dim oReply As Outlook.MailItem Set oReply = oMail.Reply strAddress = oReply.Recipients.Item(1).Address oReply.Close olDiscard -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Stanley" wrote in message ... I did this and its works fine except I can't get the SenderEmailAddress (it is not there). I can get "ReceivedTime" and "SenderName". I am using Outlook 2002. Any ideas? Thanks, Stanley . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
add multiple addresses from inbox to contacts | tee_sk | Outlook - Using Contacts | 1 | May 19th 09 10:37 AM |
EXTRACTING EMAIL ADDRESSES FROM INBOX | Gaby Huut Bay | Outlook - Using Contacts | 1 | June 26th 08 07:57 PM |
Two e-mail addresses in Inbox | Allan | Outlook Express | 3 | December 19th 07 11:52 PM |
Inbox displays new mail message but nothing new appears in Inbox | 4sh | Outlook - Installation | 0 | April 5th 07 02:24 PM |
Inbox, Sent Items & Outbox in Deleted Items in Outlook 2003 & OWA with Exchange | splounx | Outlook - General Queries | 1 | February 17th 06 02:22 AM |