show this folder as address book

G

Grd

Hi there,

I have a main contacts folder all organized into about 20 sub folders with
contain subfolders themselves. So maybe 50 folders in total.

When reorganizing my contacts I lost the 'show this folder as address book'
on all the folders and I don't want to have to put it back for each folder.

Is there VBA code to do this. I'm familiar with VBA in Access, Excel but not
in outlook and there isn't a recorder in outlook to help me get started on
the code.

Can anyone guide me with this.
Any help will be greatly appreciated.

Thanks
Suzanne
 
M

Michael Bauer [MVP - Outlook]

Suzanne, this should do it:

Public Sub StartHere()
Dim Folder as Outlook.Mapifolder
Set Folder=Application.Session.GetDefaultFolder(olFolderContacts)
SetABBook Folder
LoopFolders Folder.Folders, True
End Sub

Private Sub LoopFolders(Folders As Outlook.Folders, _
ByVal Recursive As Boolean _
)
Dim Folder As Outlook.MAPIFolder

For Each Folder In Folders
SetABBook Folder

If Recursive Then
LoopFolders Folder.Folders, Recursive
End If
Next
End Sub

Private Sub SetABBook(Folder as Outlook.Mapifolder)
On Error Resume Next
Folder.ShowAsOutlookAB = True
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Sun, 24 Feb 2008 10:10:00 -0800 schrieb Grd:
 

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