Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Posted by Andrew Gould on 07 May 2019
This video briefly explains how to choose which account is used to send emails from Outlook using Excel VBA. You'll learn how to list the account names of an Outlook profile and how to use the SendUsingAccount property of an email.
See our full range of VBA training resources, or test your knowledge of VBA with one of our VBA skills assessment tests.
This video has the following accompanying files:
File name | Type | Description |
---|---|---|
Outlook Send Using Account.xlsm | Excel workbook with macros |
Click to download a zipped copy of the above files.
There are no exercises for this video.
You can increase the size of your video to make it fill the screen like this:
Play your video (the icons shown won't appear until you do), then click on the full screen icon which appears as shown above.
When you've finished viewing a video in full screen mode, just press the Esc key to return to normal view.
To improve the quality of a video, first click on the Settings icon:
Make sure yoiu're playing your video so that the icons shown above appear, then click on this gear icon.
Choose to change the video quality:
Click as above to change your video quality.
The higher the number you choose, the better will be your video quality (but the slower the connection speed):
Don't choose the HD option shown unless your connection speed is fast enough to support it!
Is your Wise Owl speaking too slowly (or too quickly)? You can also use the Settings menu above to change your playback speed.
From: | warmday |
When: | 08 Apr 24 at 23:17 |
With regard to my previous post, I've found the solution on this website:
Dim objOutlook As Object
Dim objMail As Object
Dim objOlAccount As Object ' NEW LINE
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
Set objOlAccount = objOutlook.Session.accounts.Item(2) ' NEW LINE
With objMail
Set .SendUsingAccount = objOlAccount ' NEW LINE
.BodyFormat = 2
.To = "primaryaccount@hotmail.co.uk"
.Subject = "Some subject"
.HTMLBody = "Hi"
.Send
End With
Set objOutlook = Nothing
Set objMail = Nothing
From: | warmday |
When: | 08 Apr 24 at 23:03 |
Your video uses early binding.
Do you know if it will also work for late binding?
I tried this:
Dim objOutlook As Object
Dim objMail As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.SendUsingAccount = objOutlook.session.accounts("secondaryaccount@hotmail.co.uk")
.BodyFormat = 2
.To = "primaryaccount@hotmail.co.uk"
.Subject = "Some subject"
.HTMLBody = "Hi"
.Send
End With
Set objOutlook = Nothing
Set objMail = Nothing
but it failed on this line:
.SendUsingAccount = objOutlook.session.accounts("secondaryaccount@hotmail.co.uk")
with a
Run time error '450' Wrong number of arguments or invalid property assignment
message.
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.