NONEXECUTABLE Listing 3: Function to Obtain the Sender's Email Address Option Explicit Function SenderFromAddress(objMsg As MailItem) As String Dim strEntryID As String Dim strStoreID As String Dim objSession As MAPI.Session Dim objCDOItem As MAPI.Message ' get EntryID and StoreID for message strEntryID = objMsg.EntryID strStoreID = objMsg.Parent.StoreID ' start CDO session Set objSession = CreateObject("MAPI.Session") objSession.Logon , , False, False ' pass item to CDO and get sender address On Error Resume Next Set objCDOItem = objSession.GetMessage(strEntryID, strStoreID) SenderFromAddress = objCDOItem.Sender.Address Set objSession = Nothing Set objCDOItem = Nothing End Function