Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / May 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Grd - 16 May 2008 16:01 GMT
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
Michael Bauer [MVP - Outlook] - 16 May 2008 20:46 GMT
Why do you set ShowAsOutlookAB = False?

Signature

Best regards
Michael Bauer - MVP Outlook

 : Outlook Categories? Category Manager Is Your Tool:
 : <http://www.vboffice.net/product.html?pub=6&lang=en>

Am Fri, 16 May 2008 08:01:01 -0700 schrieb Grd:

> Hi There,
>
[quoted text clipped - 28 lines]
>     Next
> End Sub
Grd - 19 May 2008 19:53 GMT
Hi Michael,

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

Sorry about the confusion.

G

> Why do you set ShowAsOutlookAB = False?
>
[quoted text clipped - 33 lines]
> >     Next
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.