To send email from VBA in the new Outlook, you cannot use the classic CreateObject("Outlook.Application") method because the new Outlook for Windows does not support COM automation. Instead, use ShellExecute to open a pre-filled mailto link, or switch to the classic Outlook app if you need full programmatic control. This guide walks you through both approaches, plus common pitfalls and fixes.
What You'll Need
- Microsoft Excel (or any Office app with VBA) – the steps use Excel but work in Word, Access, etc.
- Basic familiarity with the VBA editor (Alt+F11).
- New Outlook for Windows installed and set up with an email account.
- If you require COM automation (attachments, direct sending), the classic Outlook desktop client must be installed and set as default.
Step-by-Step
- Open the VBA editor. In Excel, press Alt+F11. In the Project Explorer, right-click your workbook and choose Insert > Module.
- Decide on your method. For new Outlook, use the mailto approach (Method A). For classic Outlook, use COM automation (Method B).
- Method A – Mailto with ShellExecute: Paste this code into the module:
Replace the email, subject, and body with your own. UseSub SendEmailNewOutlook() Dim mailto As String mailto = "mailto:recipient@example.com?subject=Test Subject&body=Hello%20World" ShellExecute 0, "open", mailto, vbNullString, vbNullString, 1 End Sub%20for spaces and%0Afor line breaks. This opens a new message window in new Outlook with fields pre-filled; you still click Send manually. - Method B – COM automation (classic Outlook only): Paste this code:
This works only if classic Outlook is installed and set as the default mail client. New Outlook does not expose COM, so this will fail with error 429 or similar.Sub SendEmailClassicOutlook() Dim olApp As Object Dim olMail As Object Set olApp = CreateObject("Outlook.Application") Set olMail = olApp.CreateItem(0) With olMail .To = "recipient@example.com" .Subject = "Test Subject" .Body = "Hello World" .Display ' or .Send to send immediately End With Set olMail = Nothing Set olApp = Nothing End Sub - Run the macro. Press F5 or use Run > Run Sub. For Method A, your default mail app (new Outlook) opens a compose window. For Method B, classic Outlook opens the message.
- Test with attachments (Method B only). Add
.Attachments.Add "C:\path\to\file.pdf"before.Display. New Outlook via mailto cannot attach files automatically. - Handle errors. Wrap Method B in error handling to catch missing Outlook. For Method A, ensure the mailto string is properly URL-encoded.
Common Mistakes
- Using CreateObject with new Outlook. New Outlook does not support COM automation; you will get runtime error 429 (ActiveX component can't create object). Use mailto or switch to classic Outlook.
- Forgetting to URL-encode the mailto string. Spaces and special characters break the link. Use
%20for spaces,%0Afor new lines, and encode ampersands as%26. - Assuming .Send works with mailto. Mailto only opens a compose window; the user must click Send. There is no silent send.
- Not setting classic Outlook as default. If new Outlook is default, Method B may still open new Outlook or fail. Check Windows Settings > Apps > Default apps > Email.
- Missing references. For early binding (Dim olApp As Outlook.Application), add a reference to the Microsoft Outlook Object Library via Tools > References. Late binding (CreateObject) avoids this.
Tips
- Use late binding (CreateObject) to avoid version-specific reference issues.
- For mailto, build the string with a helper function that replaces spaces and line breaks.
- If you need attachments or direct sending, consider using a third-party SMTP library (e.g., CDO) instead of Outlook automation.
- Test macros with a safe recipient before sending to a distribution list.
- Keep the VBA project digitally signed if macros are blocked by security settings.
Troubleshooting
- Error 429: New Outlook cannot create the Outlook.Application object. Switch to mailto or install classic Outlook.
- Mailto opens nothing: Check that new Outlook is set as the default mail app. Also verify the mailto string has no unencoded spaces.
- Compose window opens but fields are blank: Ensure your mailto uses
?subject=and&body=correctly, and that you encoded special characters. - Macro security blocks execution: Enable macros for the file or sign the VBA project. Check Trust Center settings.
- Classic Outlook method fails silently: Add error handling to display the error number and description. Confirm Outlook is running and not in safe mode.
Frequently Asked Questions
Can I send email directly from VBA using new Outlook?
No. New Outlook does not support COM automation. You can only open a pre-filled compose window via mailto; the user must click Send.
Why does CreateObject("Outlook.Application") fail?
Because new Outlook does not register the COM interface. Use classic Outlook or an alternative like CDO.
How do I add attachments with mailto?
You cannot. Mailto does not support attachments. Use classic Outlook with COM or an SMTP library.
Can I use VBA to send email from Excel with new Outlook?
Yes, but only via ShellExecute with a mailto link. The message opens in new Outlook for manual sending.
What is the difference between .Display and .Send?
.Display shows the email for review; .Send sends immediately. Both require classic Outlook COM.