Results 1 to 1 of 1

Senders Email Address: Outlook 2013 to Excel 2013 Not Working

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-09-2010
    Location
    London
    MS-Off Ver
    Excel Version Office 365
    Posts
    215

    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 As String, objSender As Outlook.AddressEntry, PA As Variant, i  As Byte
    Dim strEmail As String
    
    If Item.SenderEmailType <> "EX" Then
            Get_Sender_Address = Item.SenderEmailAddress
    Exit Function
    End If
    
    PA = Array("0x5D01001F", "0x5D02001F", "0x800F101F", "0x39FE001E", "0x39FE001F", "0x5D09001F", "0x0C1F001E")
    
    On Error GoTo e
    
    s = "Type1" & vbCrLf
    For i = LBound(PA) To UBound(PA)
        strEmail = Item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/" & PA(i))
            If InStr(1, strEmail, "@") Then
                Get_Sender_Address = strEmail
            Exit Function
            End If
    Next i
     
    Set objSender = Item.sender
    For i = LBound(PA) To UBound(PA)
        strEmail = objSender.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/" & PA(i))
            If InStr(1, strEmail, "@") Then
                Get_Sender_Address = strEmail
            Exit Function
            End If
    Next i
    
    
    strEmail = objSender.GetExchangeUser.PrimarySmtpAddress
            If InStr(1, strEmail, "@") Then
                Get_Sender_Address = strEmail
            Exit Function
            End If
    
    strEmail = Item.SmtpAddress
            If InStr(1, strEmail, "@") Then
                Get_Sender_Address = strEmail
            Exit Function
            End If
    
    e:
    Err.Clear
    Resume Next
    End Function
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting Error while extracting body of the email from Outlook 2013 using Excel VBA
    By Naveed Raza in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2016, 10:47 AM
  2. [SOLVED] use outlook group to send email using excel 2013 vba
    By cmccabe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2016, 10:50 AM
  3. Excel & Outlook 2013 - Import email body lines into columns
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2016, 03:57 PM
  4. VBA code working in Outlook 2010 but not in 2013
    By fiffers in forum Outlook Programming / VBA / Macros
    Replies: 5
    Last Post: 10-01-2015, 08:52 AM
  5. Replies: 3
    Last Post: 07-20-2014, 11:46 AM
  6. Excel 2013 and Outlook 2013
    By xlbeginnerxl in forum Excel General
    Replies: 3
    Last Post: 03-26-2014, 12:16 PM
  7. Hyperlink to Outlook 2013 email or attachment
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-18-2013, 03:07 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1