Select Alternate profile

  • Thread starter Thread starter Mark Parent
  • Start date Start date
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!
 
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.
 
Back
Top