Address lookup doesn't work when adding to outlook address book

G

Grd

Hi There,

I have a routine below that adds contact folders and subfolders to the
outlook address book (see below) however when I type a partial name and check
names it doesn't resolve- I have to click the To button and find it. If I add
the folders to the outlook address book manually the lookup works. But I
don't want to keep doing that because there are a lot of folders and I setup
outlook on quite a few machines.

Any help / guidance would be great

Tx

Gordon

Sub ShowAsAddressBookChange()
' Variable Declarations
Dim olApp As Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim fldFolder As Outlook.MAPIFolder
' Variable Assignments
Set olApp = Outlook.Application
Set nmsName = olApp.GetNamespace("Mapi") 'Create instance of namespace
Set fldFolder = nmsName.GetDefaultFolder(olFolderContacts)
' Loop to change in each folder and subfolder
For i = 1 To fldFolder.Folders.Count
For j = 1 To fldFolder.Folders(i).Folders.Count
fldFolder.Folders(i).Folders(j).ShowAsOutlookAB = False
Next j
fldFolder.Folders(i).ShowAsOutlookAB = False
Next
End Sub
 
G

Grd

Hi Michael,

ShowAsOutlookAB = False should read true. I was just testing it and
accidentally pasted it with False.

Sorry about the confusion.

G
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top