Consulting

Results 1 to 1 of 1

Thread: Senders Email Address: Outlook 2013 to Excel 2013 Not Working

  1. #1

    Senders Email Address: Outlook 2013 to Excel 2013 Not Working

    Hi Community

    I have exhausted all possible solutions and still cannot get this to function at work. It works at home on Excel/Outlook 2016

    At work I am using Excel/Outlook 2013 and all the columns are populated except the Sender's email address. That column remains blank.

    I have shown the code I am using below. Can someone suggest what may be wrong that it is not working at Work using Excel/Outlook 2013 please?

    I have also attached the file.

    Function Get_Sender_Address(Item As MailItem) Dim s AsString, objSender As Outlook.AddressEntry, PA AsVariant, i AsByte Dim strEmail AsString If Item.SenderEmailType <> "EX"Then Get_Sender_Address = Item.SenderEmailAddress ExitFunction EndIf PA = Array("0x5D01001F", "0x5D02001F", "0x800F101F", "0x39FE001E", "0x39FE001F", "0x5D09001F", "0x0C1F001E") OnErrorGoTo e s = "Type1" & vbCrLf For i = LBound(PA) ToUBound(PA) strEmail = Item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/" & PA(i)) If InStr(1, strEmail, "@") Then Get_Sender_Address = strEmail ExitFunction EndIf Next i Set objSender = Item.sender For i = LBound(PA) ToUBound(PA) strEmail = objSender.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/" & PA(i)) If InStr(1, strEmail, "@") Then Get_Sender_Address = strEmail ExitFunction EndIf Next i strEmail = objSender.GetExchangeUser.PrimarySmtpAddress If InStr(1, strEmail, "@") Then Get_Sender_Address = strEmail ExitFunction EndIf strEmail = Item.SmtpAddress If InStr(1, strEmail, "@") Then Get_Sender_Address = strEmail ExitFunction EndIf e: Err.Clear ResumeNext EndFunction
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •