show this folder as address book

  • Thread starter Thread starter Grd
  • Start date Start date
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
 
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:
 
Back
Top