Outlook VBA - Change Address Book

dognz

New Member
Joined
Feb 18, 2002
Messages
27
This is a Outlook VBA question - but I am sure someone will be able to provide me with an answer.

I want to be able to change the default Outlook Address List that is displayed in the Address Book Dialog box. I have the code below to display the Outlook Address book.

Private Sub cmd_address_click()

Dim objsession As Object
Dim adbook As Object

'creates link to outlook
Set objsession = CreateObject("MAPI.Session")
objsession.Logon , , False, False

On Error Resume Next

' show address book
Set adbook = objsession.AddressBook(, _
"Address Book", , , , , "")

Set objsession = Nothing
Set adbook = Nothing

End Sub

I want to be able to specify which address list is shown - eg. "Global Address List"

I am using Office 97 - so am codeing Outlook from Excel. Any help greatly appreciated.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top