Non-default Mailbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have code (see below) that accesses the default mailbox InBox. I can't
figure out how to set to a non-default mailbox. Somehow I think I am supposed
to use the Folders collection, but I can get it to work. Any suggestions?
Thanks.

Set olMAPI = GetObject("", "Outlook.Application").GetNamespace("MAPI")
Set curInbox = olMAPI.GetDefaultFolder(olFolderInbox)
 
So I guess I am suppsoed to use GetSharedDefaultFolder, but that wants to use
CreateRecipient, but the recipient already exists. Or does it just check to
see if the recipient exists? Form the outstanding Microsoft documentation, it
is impossible to tell. Thanks. Any hints will be greatly appreciated.
 
You can supply any valid Recipient object. You must somehow create the
Recipient object of course.

If the non-default mailbox is opened as part of the profile then you can use
the Folders collection of the NameSpace object and iterate that collection
until you find the mailbox you want. That won't work if the store isn't
opened as part of the Outlook profile however.
 
Back
Top