Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get reference to additional Inbox

Tags:

I'm using Outlook 2007 - and have my main mailbox: Tait, Mark

I have also added another mailbox to my profile: Procurement, Request

Both appear as top level folders within Outlook:

Mailbox - Tait, Mark> -Conversation History
-Deleted Items
-Drafts
-Inbox
-Junk E-Mail

Mailbox - Procurement, Request
--Conversation History
--Deleted Items
--Drafts
--Inbox
--Junk E-Mail

I can get a reference to my default Inbox (Tait, Mark) using:
Set Inbox = ns.GetDefaultFolder(olFolderInbox)

How do I get a reference to the Inbox in the "Procurement, Request" mailbox?

like image 616
Mark Avatar asked Jan 31 '12 08:01

Mark


People also ask

How do I access someone else's email on Outlook?

In the Navigation bar on the top of the Outlook Web App screen, click on your name. A drop-down list will appear. Click Open another mailbox. Type the email address of the other mailbox that you want to open, and click Open.

How do I add an Inbox to Outlook?

Adding the Mailbox to Outlook (2016 or Newer)In Account Settings, select your current Mailbox and click Change. On the next screen click “More Settings…” Select the Advanced tab and click the Add button. Type in the email address of the shared mailbox then Click OK.


1 Answers

Something like this should do the trick

Dim objNS As Outlook.NameSpace Dim objFolder As Outlook.MAPIFolder Set objNS = GetNamespace("MAPI") Set objFolder = objNS.Folders("Procurement, Request") Set objFolder = objFolder.Folders("Inbox") 

This link has some useful code for handling different Inboxes - it may be of interest

like image 85
brettdj Avatar answered Sep 19 '22 17:09

brettdj