title: Get sender's SMTP email address with Excel VBA
body: <p>I pull the Subject, received date and sender's name with the following code:</p>
  
  <pre><code>Set InboxSelect = GetObject("", "Outlook.Application").GetNamespace("MAPI").PickFolder
  i = 0: EmailCount = 0
  EmailCount = InboxSelect.Items.Count
  While i &lt; EmailCount
      i = i + 1
      blastRow = Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
      LastRow = Sheets("Body").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
      With InboxSelect.Items(i)
          MsgBox (SenderEmailAddress)
          'If .senderemailaddress = "*@somethingSpecific.co.uk" Then
              'EmailCount = EmailCount + 1
              Sheets("Import Data").Range("A" &amp; blastRow).Formula = .SenderName
              Sheets("Import Data").Range("B" &amp; blastRow).Formula = Format(.ReceivedTime, "dd/mm/yyyy")
              Sheets("Import Data").Range("C" &amp; blastRow).Formula = .Subject
              Sheets("Body").Range("A" &amp; LastRow).Formula = .Body
          'End If
      End With
  Wend
  </code></pre>
  
  <p>What I'm trying to achieve now is an if statement that will say "If the sender's email address is 'anything@somethingSpecific.co.uk' then execute that code. 
  I've tried SenderEmailAddress but it returns blank when tested in a message box.</p>
  
  <p>EDIT: <code>/O=*SET1*/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=*VARIABLE1*</code> is now being returned in the immediate window every time with the below code:</p>
  
  <pre><code>Set InboxSelect = GetObject("", "Outlook.Application").GetNamespace("MAPI").PickFolder
  i = 0: EmailCount = 0
  EmailCount = InboxSelect.Items.Count
  While i &lt; EmailCount
      For Each Item In InboxSelect.Items
          Debug.Print Item.senderemailaddress
          If Item.senderemailaddress = "/O=SET1/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=*" Then
              i = i + 1
              blastRow = Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
              LastRow = Sheets("Body").Cells(Rows.Count, 1).End(xlUp).Offset(1).Row
              With InboxSelect.Items(i)
                      Sheets("Import Data").Range("A" &amp; blastRow).Formula = .SenderName
                      Sheets("Import Data").Range("B" &amp; blastRow).Formula = Format(.ReceivedTime, "dd/mm/yyyy")
                      Sheets("Import Data").Range("C" &amp; blastRow).Formula = .Subject
                      'PASTING BODY IS SLOW
                      Sheets("Body").Range("A" &amp; LastRow).Formula = .Body
                  'End If
              End With
          End If
      Next Item
  Wend
  </code></pre>
  
  <p>What I've attempted to do is use a wildcard symbol (the *) to act as the variation in the returned message but that hasn't worked, is there a better way to do this? </p>