Results 1 to 2 of 2

Thread: Outlook AddressBook DialogBox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    NJ
    Posts
    148

    Question

    I'm developing an appication that will interact with MS Outlook by automatically sending out an email based upon criteria entered into the VB app.

    I want the user to be able to view their AddressBook to select the person they want to send the email to. I cannot figure out how to do this using the Outlook component and was wondering if anyone knows an API call to call the dialog box and return the selection.

    Any info would be appreciated.

    Thanks,

    Mike Rossi

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878

    Post close, but no cigar

    I don't think that there is a "Common Dialogue" type of API for Outlook.

    You can certainly (Outlook 2000) get at the address book entries, and display them to the user, and let the user choose one - but I think you need to use your own dialogue box and display.

    There is a .Detail method on the address entry, that shows a modal box with the details in it.

    Some (Outlook 2000) code that might help: Don't forget the reference to Microsoft Outlook 9.0 Object Library.

    Dim myOlApp As Outlook.Application
    Dim myNameSpace As Outlook.NameSpace
    Dim myAddressList As Outlook.AddressList
    Dim myAddressEntries
    Dim myAddressEntry
    Dim myCount As Integer
    Dim x
    Dim address

    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    myCount = myNameSpace.AddressLists.Count

    For x = 1 To myCount
    Set myAddressList = myNameSpace.AddressLists(x)
    MsgBox myAddressList

    If myAddressList.AddressEntries.Count > 0 Then
    Set myAddressEntry = myAddressList.AddressEntries(1)
    address = myAddressEntry.address
    MsgBox myAddressEntry & " :: " & address

    End If
    Next x

Posting Permissions

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



Click Here to Expand Forum to Full Width