Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Date Received/Date Sent from the Outlook Object Library

Status
Not open for further replies.

jwestmore

Programmer
May 27, 2003
14
US
Hi Everyone,

I'm trying to pull the date sent and date received values from e-mails in my Inbox using Vb's Outlook object library. Anybody have any idea what the syntax is for something like that? inbox.items(i).???

Thanks!
Jon
 
Code:
Dim objApp As Outlook.Application
Dim objNS As Outlook.Namespace
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(olFolderInbox)
For Each objItem In objFolder.Items
 With objItem
  Debug.Print "Date sent: " & .SentOn
  Debug.Print "Date received: " & .ReceivedTime
 End With
Next

Set objItem = Nothing
Set objNS = Nothing
Set objApp = Nothing

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top