Can somebody give me info on how to work with "Folders"

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

I am mainly concerned with CONTACTS (in other than default PSTs and in other
than DEFAULT FOLDER locations.)

Lets say I have have 3 different PST files open, and the one in question is
"Test1" (located at c:\test.pst) and the folder I want is CONTACTS/ThisList

What if I have a second "Test1" opened (located at c:\temp\test.pst)
I know I need to use the MAPIFolder and an INDEX number, but how do I find
out what one I need?
I have used the GETFOLDER (I think this is Sue's) but I am not sure how to
handle the different folder/PST issues/

Also, on the same line, how can I WALK the tree of folders? I want to
process each folder, and if it is a MAIL folder, to run a script against
each mail in that folder, then go to the next folder. I will need to know
the folder name.



Thanks
Bruce
 
A basic recursive procedure to do something to all items in a folder might
look something like this:

Sub DoSomethingToAllItems(myFolder)
For Each objItem in myFolder.Items
' code to do something to objItem
Next
For Each objFolder in myFolder.Folders
Call DoSomethingToAllItems(objFolder)
Next
End Sub

You should use a unique display name for each .pst file. Otherwise, you're
not likely to be able to distinguish among them, except that only one will
be the default.
 
Back
Top