Select Alternate profile

M

Mark Parent

In my Outlook, under File - Open, I can see two Profiles.
Parent, Mark (Inbox)
Alternate, TD (Inbox)
The folders that appear only show those under Parent, Mark but if I select
the Alternate profile, I can read the Alternate inbox.

I need my VBA code to select the Alternate profile, and read that Inbox
contents. My code appears below; the Set REPRICE statement is failing. Can
I not select the Alternate Profile this way?

Set objApp = GetObject(, "Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set REPRICE = objNS.Folders.Item("Alternate, TD")
Set MyFolder = REPRICE.Folders.Item("Inbox")

Thanks all for your time and assistance!
 
K

Ken Slovak - [MVP - Outlook]

What you are referring to as profiles sound like delegate mailboxes. Are you
on Exchange server, and is Alternate an Exchange mailbox? If that's the case
then you would use the NameSpace.GetSharedDefaultFolder() method to access
that Inbox.

See the Object Browser help on that method for an example of how to use it.
 

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