Thanks KG.
Don't mean to be rude, but those don't exactly answer my question. your time wasn't waisted though, because one of your links gave me the answer to something else I was trying to do.
What I'm trying to do is retrieve the Folder names in my inbox and list them in a treeview.
I finally figured it out (sort of)...
This is what I have so far but all my folders are "flat" and the SubFolders are all shown at the top level.
Code:
Private Sub AddFoldersToTree(ThisInbox As Outlook.MAPIFolder)
Dim mySbFldr As Outlook.MAPIFolder
NodeCnt = NodeCnt + 1
For Each SbFldr In ThisInbox.Folders
TreeView1.Nodes.Add(SbFldr.Name & NodeCnt, SbFldr.Name)
AddEmailFolderToTree(SbFldr, SbFldr.Name & NodeCnt)
Next SbFldr
End Sub
So for example I want my treeview to look something like this.
Code:
+Personal Inbox
-Work Inbox
|_Staff
|_Anne Jameson
|_Peter Smith
|_Steve Jones
|_Suppliers
|_Goggles
|_Kinkos
|_Retail
|_Wholesale
|_Tesco
But at the moment it's showing this
Code:
Work Inbox
Staff
Anne Jameson
Peter Smith
Steve Jones
Suppliers
Goggles
Kinkos
Retail
Wholesale
Tesco
Thanks