Results 1 to 3 of 3

Thread: VBS Code to Pull Email SMTP Address From Outlook And Send Email

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    21
    Rep Power
    0

    VBS Code to Pull Email SMTP Address From Outlook And Send Email

    I need to get vba to look at the name in column G and find the email in outlook global address list. Thanks

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    There's a method called Resolve in Outlook. Try to look it up, and you'll be able to figure out how to get an email address from the global directory, by passing the name.. You must remember that if exactly same names exist in the global list, then you will not get a valid email ID.

    Just refer to http://www.excelfox.com/forum/f2/out...nt-and-cc-628/ as a starting point.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Moderator
    Join Date
    Jul 2012
    Posts
    156
    Rep Power
    12
    Try this one as a test.
    Code:
    Sub Read_Contact_Email()
        c00 = "Fullname"
        With CreateObject("Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(10).Items(c00)
            c01 = .Email1Address
        End With
        MsgBox c01
    End Sub
    Remember that Fullname has to be exactly the same as in addresslist otherwise you recieve an errormessage.

Similar Threads

  1. Replies: 12
    Last Post: 12-10-2019, 09:56 PM
  2. VBA To Extract Email Address From Text
    By dunndealpr in forum Excel Help
    Replies: 43
    Last Post: 06-05-2019, 03:56 PM
  3. VBA Code to email using Globals Address Book
    By cdurfey in forum Excel Help
    Replies: 5
    Last Post: 05-28-2013, 10:25 PM
  4. How To Send Outlook Email Using VBA
    By mfaisalrazzak in forum Excel Help
    Replies: 7
    Last Post: 03-03-2013, 03:09 AM
  5. Send Outlook Email With Word Document
    By Murali K in forum Excel Help
    Replies: 2
    Last Post: 06-27-2012, 08:42 PM

Tags for this Thread

Posting Permissions

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