I am using a VBA macro in Excel 2007 to send emails from Outlook 2007 using info in the excel sheet. I wanted to be able to send from a different mail account than the default and added the following line to the macro before the .send command
.SendUsingAccount = OutApp.Session.Accounts.Item(3)
but it has no effect. Whatever account number is selected as the Item Outlook still sends from the default account. As a 'workaround' I can change the default account before I run the macro but I would prefer to have it select the correct account from within the macro. Does anyone know what I may be doing wrong or know a way to do this?
.SendUsingAccount = OutApp.Session.Accounts.Item(3)
but it has no effect. Whatever account number is selected as the Item Outlook still sends from the default account. As a 'workaround' I can change the default account before I run the macro but I would prefer to have it select the correct account from within the macro. Does anyone know what I may be doing wrong or know a way to do this?