Importing from an Outlook secondary mailbox

Steve400

Registered User.
Local time
Today, 11:47
Joined
May 1, 2013
Messages
33
I am importing emails into Access from Outlook and am having trouble defining the correct mailbox. I have 2 inboxes, I can import from my default one but do not know the code for my 2nd mailbox. I can accomplish this with a .pickfolder command but wish to automate it.
I have the below code but the Set Inbox line is incorrect.
Can someone please help.
thanks


Set Ola = New Outlook.Application
Set Nsp = Ola.GetNamespace("MAPI")
Set Inbox = Nsp.Folders("My2ndInbox").Folders("Inbox")
Set newdest = Inbox.Folders("ImportedEmails")
Set rs = CurrentDb.OpenRecordset("tblEmail", dbOpenDynaset)
 

Users who are viewing this thread

Back
Top Bottom