Finding other folders in Outlook

  • Thread starter Thread starter Richard Ferguson
  • Start date Start date
R

Richard Ferguson

Hi All,

I'm currently using the following code to access another Outlook 2000
mailbox (other than my own) to create new folders underneath. All works ok
so far.

Set mynamespace = Outlook.Application.GetNamespace("MAPI")
Set MailBox = mynamespace.CreateRecipient([email protected])
Set InboxFolder = mynamespace.GetSharedDefaultFolder(MailBox, olFolderInbox)
Set NewFolder = InboxFolder.Folders.Add("NewlyCreatedFolder")


However, this works ok for the default Inbox folder of this mailbox. I have
other folders manually created directly underneath the mailbox (when viewing
it in Outlook) eg, Calendar, Contacts, Sent Items etc, I have also added
folders such as Test, Procedures, Statistics at the same level. If these
folders were beneath the Inbox, I can find them no problem, but is there a
way to search and create folders up one level at the same heirarchial level
as Inbox, Contacts, Calendar, etc (hope this isn't too confusing.

Cheers,

Richard Ferguson.
 
Each folder has a Parent property representing its parent folder. Sounds
like you want to create folders in the Inbox's Parent.Folders collection.
 
Back
Top