Search code examples
vbaoutlookoutlook-2010

Outlook VBA .SendUsingAccount when no account is available


Story: In Outlook App there is one default/user account and also additional inbox, calendar (let's call it 2nd_Account) etc. added (visible) as folders based on the Exchange Server permission.

I need to programmatically create new appointment item and send it on behalf of 2nd_Account. Problem is that in Application.Session there is only 1 account (the default one).

If done manually by user, then item created from 2nd_Account olCalendar folder is SendOnBehalf of the 2nd_Account, even though it is not included in Accounts collection. Any ideas, please?

Thank you


Solution

  • Create the appointment in the Calendar folder of that account - use Store.GetDefaultFolder instead of Namespace.GetDefaultFolder.