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

List of Folders



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 6th 07, 08:34 PM posted to microsoft.public.outlook.program_vba
Daniel
external usenet poster
 
Posts: 38
Default List of Folders

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
  #2  
Old April 9th 07, 08:34 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default List of Folders


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

  #3  
Old October 2nd 07, 01: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


 




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
OL2k3 Automatically Adding Public Folders to 'Favorite Folders' list in Mail Ben Outlook - General Queries 0 October 4th 06 05:19 PM
another pst file has attached itself to my all mail folders list louise Outlook - General Queries 2 May 22nd 06 04:15 AM
Some contact folders in Folders List not appearing in Contacts ee Outlook - Using Contacts 3 March 20th 06 09:58 PM
I can't delete mail folders from the folder list. GaryK Outlook - Installation 2 March 17th 06 08:17 AM
Change Folder List to Put Public folders at top [email protected] Outlook - General Queries 2 January 20th 06 02:08 AM


All times are GMT +1. The time now is 08:15 PM.


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