September 6, 2019
Hi,
Please can you help to handle attach macro to let me choose which account will be used to send email as I have two in my PC.
Thanks,
Marsil
October 5, 2010
Hi Marsil,
Insert this snippet into your code after you've created objOutlookMsg
Dim Account As Outlook.Account For Each Account In objOutlook.Session.Accounts 'Debug.Print Account.DisplayName If Account.DisplayName = "Insert account name" Then objOutlookMsg.SendUsingAccount = Account End If Next
Insert the account name you want to use in place of the red text. If your not sure of the account name, uncomment the green line and all account names will be printed to the Immediate Window.
Regards
Phil
Answers Post
September 6, 2019
Hi Phil,
It is ok now as I changed the macro to add many attached files, but I face an issue to add below to select which Outlook account to send email.
please check attached file and I really appreciate your help and time to update the macro.
Dim Account As Outlook.Account For Each Account In objOutlook.Session.Accounts 'Debug.Print Account.DisplayName If Account.DisplayName = "Insert account name" Then objOutlookMsg.SendUsingAccount = Account End If Next
Thanks;
Marsil
1 Guest(s)