Click to See Complete Forum and Search --> : Outlook AddressBook DialogBox
rossim
Feb 5th, 2001, 11:32 AM
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
JordanChris
Feb 6th, 2001, 10:10 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.