A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 16th 08, 04:01 PM posted to microsoft.public.outlook.program_vba
Grd
external usenet poster
 
Posts: 4
Default Address lookup doesn't work when adding to outlook address book

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
Ads
  #2  
Old May 16th 08, 08:46 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Address lookup doesn't work when adding to outlook address book



Why do you set ShowAsOutlookAB = False?

--
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,

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

  #3  
Old May 19th 08, 07:53 PM posted to microsoft.public.outlook.program_vba
Grd
external usenet poster
 
Posts: 4
Default Address lookup doesn't work when adding to outlook address boo

Hi Michael,

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

Sorry about the confusion.

G

"Michael Bauer [MVP - Outlook]" wrote:



Why do you set ShowAsOutlookAB = False?

--
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,

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No Outlook Contact display option in address book lookup Eric Kirchberg Outlook - Using Contacts 1 October 14th 07 02:22 PM
problem adding an address book in outlook 2007! eric l Outlook - Using Contacts 1 July 12th 07 02:38 AM
Having problems adding ACT! address book to Outlook 2003 vince Outlook - Using Contacts 0 July 6th 06 08:11 PM
Address book lookup settings QRT123 Outlook - General Queries 1 March 6th 06 08:42 PM
Address book lookup???? HenryG Outlook - Using Contacts 1 January 18th 06 05:33 PM


All times are GMT +1. The time now is 08:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.