Non-default Mailbox

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)
 
G

Guest

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.
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top