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