![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#5
|
|||
|
|||
![]()
Firstly add a reference to Outlook within your project. Secondly import the
namespace before the beginning of your class, ie:- Imports Microsoft.Office.Interop.Outlook -- Alan Moseley IT Consultancy http://www.amitc.co.uk If I have solved your problem, please click Yes below. Thanks. "Marvin Buzz" wrote: I am getting a compiler error that says I cannot define user types. "Alan Moseley" wrote: You need to write a sub or function that is recursively called by itself. For example:- Public Sub ProcessAllFolders() Dim fld As MAPIFolder For Each fld In Application.GetNamespace("MAPI").Folders Call ProcessFolder(fld) Next fld End Sub Public Sub ProcessFolder(ByRef fld As MAPIFolder) Dim subfld As MAPIFolder 'Do Something here For Each subfld In fld.Folders Call ProcessFolder(subfld) Next subfld End Sub -- Alan Moseley IT Consultancy http://www.amitc.co.uk If I have solved your problem, please click Yes below. Thanks. "Marvin Buzz" wrote: I am writing in Visual Basic, not VBA. I can write the code to identify all of the subfolders in Outlook, but do not know how to program for the subfolders of the subfolders...subfolders to any possible depth of subfolders. Any samples or guidance would be very much appreciated. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Script to List Folders/subfolders | joshboski | Outlook and VBA | 2 | June 19th 08 01:36 PM |
Customizing views for ALL folders/subfolders | Trond Svendsen | Outlook - General Queries | 1 | April 1st 08 10:47 AM |
Graph of Inbox folders and subfolders | Mahsa Pedrami | Outlook - Using Contacts | 1 | September 10th 07 08:57 AM |
Columns lost. Fix for all folders and subfolders? | Jeff Hofstetter | Outlook - General Queries | 2 | August 7th 06 09:23 PM |
Public Folders - Search Subfolders is Greyed Out | Chris Briant | Outlook - General Queries | 1 | July 19th 06 03:59 PM |