Thread: List of Folders
View Single Post
  #3  
Old October 2nd 07, 12:02 AM posted to microsoft.public.outlook.program_vba
greggmendel
external usenet poster
 
Posts: 1
Default List of Folders

Nooby question he I get a 424 (Object Required) message at execute time on
the "For Each oFld In oFolders" line. What might I be doing wrong?

"Michael Bauer [MVP - Outlook]" wrote:


Here's a sample for how to loop through all of the folders:

Public Sub LoopFolders(oFolders As Outlook.Folders, _
ByVal bRecursive As Boolean _
)
Dim oFld As Outlook.MapiFolder

For Each oFld In oFolders
If oFld.DefaultItemType = olContactItem Then
' Contact folder
End If

If bRecursive Then
If oFld.Folders.Count Then
LoopFolders oFld.Folders, bRecursive
End If
End If
Next
End Sub

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Fri, 6 Apr 2007 11:34:03 -0700 schrieb Daniel:

Hello,

I am try, through Access, to retrieve a complete listing of all the

contact
folder for an outllok profile. Could someone give me a good nudge in the
right direction. I am new at programming with Outlook so please give as

much
detail as possible.

Thank you for the help,

Daniel P


Ads