Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,468
    Thanks
    30
    Thanked 61 Times in 57 Posts

    Find Excel entry in Outlook (XP)

    Is there a way from Excel to find a cell entry (e.g., a person's last name) in an Outlook contact database?

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Find Excel entry in Outlook (XP)

    Yes, but it's going to be a bit of VBA coding work. (HansV and some of the other hotshots might be able to code it in a few minutes, but not me! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>). Generally, you'll have to instantiate Outlook from your Excel code (there are some examples in the Excel Forum), then set up a reference to the Default Contacts MapiFolder then loop through the Contacts Folder for a Name match (there will be some examples of this in the Outlook Forum). What Contact data do you want to return to Excel?
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,468
    Thanks
    30
    Thanked 61 Times in 57 Posts

    Re: Find Excel entry in Outlook (XP)

    I wanted to enter the last name and retrieve the business telephone number; or enter the company name and retrieve their phone number and contact person.

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,468
    Thanks
    30
    Thanked 61 Times in 57 Posts

    Re: Find Excel entry in Outlook (XP)

    Oh, I didn't think this would be easy...these Office applications really don't interface!!

  5. #5
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Find Excel entry in Outlook (XP)

    Edited by <!profile=unkamunka>unkamunka<!/profile> to correct link

    I don't use outlook and most of the "coding" will need to be from outlook
    Here is some example code for automating outlook from excel.

    Here is some code for listing the entries in an outlook address book.

    Here is the page I got both from. There might be some other things of use.

    You will essentially use

    <pre> Dim OutlookApp As Object
    Set OutlookApp = CreateObject("Outlook.Application")</pre>


    to create/open the outlook application in Excel. Then using outlook VB code you will have to get the outlook address book info. Once you get that in variables you can use it in excel. I know nothing about outlook so once I createobject I have no further idea of what to do without "playing" and I don't use outlook at all so can not play.

    HTH,
    Steve

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Find Excel entry in Outlook (XP)

    Word has a method to query the address book which, by default, is the Outlook Contacts folder (or, in older times, the Outlook Personal Address Book). I'm not sure whether Excel has such a method, or whether you would want to automate Word to access the method, or whether pure Outlook code will be most efficient.

    (Did I help? <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> )

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Find Excel entry in Outlook (XP)

    Word has (as you well know <img src=/S/grin.gif border=0 alt=grin width=15 height=15>) Application.GetAddress; If Excel has an equivalent Method, it's not at the Application level.
    -John ... I float in liquid gardens
    UTC -7ąDS

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Find Excel entry in Outlook (XP)

    <P ID="edit" class=small>(Edited by JohnBF on 14-Feb-04 14:17. Code fixes and improvements.)</P>Attached is some starter code: it doesn't cover Business Name and Contact Person at this point, and undoubtedly has some bugs (returns empty/blank entries along with real entries in my brief test). Activate the reference to the Outlook Object Model, and look in the Outlook VBE for all the properties of ContactItems. (And you can thank the tedious conference calls during which I cobbled this together. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>)
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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