Consulting

Results 1 to 4 of 4

Thread: Sender and Recipient Address From Email

  1. #1
    VBAX Regular
    Joined
    Jan 2014
    Posts
    15
    Location

    Sender and Recipient Address From Email

    Hi Guys,

    I have found the following code which I have adapted to collate the senders email address from the currently selected email. However, I would like to expand on this to also collate the recipients email address.

    Can any body offer any input or alternative code which will suit my needs.

    Public Sub GetSmtpAddressOfCurrentEmail()
        Dim currentExplorer As Explorer
        Dim currentItem As Object
        Dim sSender As Variant
       
        Set currentExplorer = Application.ActiveExplorer
       
        If Application.ActiveExplorer.Selection.Count = 1 Then
            Set currentItem = ActiveExplorer.Selection.Item(1)
            sSender = GetSmtpAddress(currentItem)
            MsgBox sSender
        Else
            MsgBox ("Please select only one message.")
            Exit Sub
        End If
          
    End Sub
    I cannot post the function due to URL restrictions, but it can be found here - gregthatcher.com Scripts VBA Outlook GetSmtpAddress.aspx (Replace the spaces with /)

    Thanks in advance.

  2. #2
    Greg Thatcher's web site also includes code that details all the information that can be gleaned from an e-mail message - http://gregthatcher.com/Scripts/VBA/...yAccessor.aspx
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    Looking to automatically save an incoming email that was saved to an outlook folder to a folder on my hard drive using particular keywords from the email subject line. Thank you.

  4. #4
    VBAX Regular
    Joined
    Jan 2014
    Posts
    15
    Location
    Quote Originally Posted by gmayor View Post
    Greg Thatcher's web site also includes code that details all the information that can be gleaned from an e-mail message
    Thanks, I have tried all of the Outlook scripts on the website and I cannot seem to modify to my requirements.

    I want to restrict this to purely the sender and recipient email addresses themselves i.e.

    sender at sender dot com
    recipient at recipient dot com

Posting Permissions

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