Outlook Error Codes

Fix Outlook Error 80004005: Outlook Does Not Recognize One or More Names in VBA

Natalie TaylorNatalie Taylor Oct 19, 2026 868 views

Question details

The user encounters a run-time error when trying to send automated Outlook emails with PDF attachments via VBA, as the system fails to recognize specific recipient email addresses.

How to Fix Outlook Error 80004005: Does Not Recognize One or More Names
Product
Microsoft Outlook
Device & OS
not provided
Scenario
Sending emails programmatically using Access or Excel VBA macros.
Observed behavior
The macro throws Run-time error '-2147467259 (80004005): Outlook does not recognize one or more names' on the .Send line for certain recipients, even though the same addresses work when emails are composed manually.
Before you start

Ensure that the email addresses causing the error are spelled correctly and formatted properly, and verify that your VBA editor is properly connected to the Microsoft Outlook Object Library in the References menu.

Solution 1Recommended

Add the .Recipients.ResolveAll Command to Your VBA Code

Force Outlook to explicitly resolve and validate the email addresses against its address book before executing the send command.

During programmatic sending, Outlook sometimes bypasses automatic recipient resolution to save processing time, which triggers the 80004005 error. Manually calling the ResolveAll method forces the Outlook application to validate the names before the macro attempts to send the message.

1
Open the VBA Editor

Press ALT + F11 to open the Visual Basic for Applications (VBA) editor and locate the module containing your email generation script.

2
Locate the email configuration block

Find the section of your code where the Outlook MailItem properties are defined (usually starting with 'With obj_OL_MailItem').

3
Insert the ResolveAll command

Immediately before the '.Send' command, insert a new line and type '.Recipients.ResolveAll'.

4
Run and test the macro

Save your code changes and run the macro again to verify that the previously problematic email addresses are now processed correctly.

Add the .Recipients.ResolveAll Command to Your VBA Code
Validation Tip: You can check the return value of ResolveAll (which returns True or False) using an If statement. This allows you to programmatically detect unresolved names and display a warning message instead of letting the script crash.
Free Microsoft Office alternative

Experience a Smoother Workflow with WPS Office

Tired of troubleshooting complex VBA errors and macro compatibility issues in Microsoft Office? WPS Office offers a free, lightweight, and highly compatible alternative. Enjoy seamless document creation and editing without the steep learning curve or technical headaches.

Completely free and lightweight office suiteHigh compatibility with Microsoft Word, Excel, and PowerPoint formatsIntuitive, tabbed interface requiring no learning curveBuilt-in PDF tools for seamless file conversions and attachments
QA img-9

Frequently Asked Questions

Why does error 80004005 only happen with specific email addresses in VBA?

This usually occurs when an email address is not stored in your cached Outlook address book or requires a specific background DNS/SMTP lookup. Outlook's programmatic VBA interface skips this background resolution by default to execute code faster, causing it to fail on unrecognized addresses.

Can I manually send emails to the addresses causing this VBA error?

Yes. When you manually compose an email in the Outlook interface, the software actively resolves the recipient in the background as you type. The 80004005 error is strictly limited to automated VBA macro operations where this automatic resolution does not occur.

How do I check if an email resolved successfully before sending in VBA?

You can assign the result of the resolution to a boolean check. For example: 'If Not .Recipients.ResolveAll Then MsgBox "Unresolved recipient found!"'. This allows your code to pause or handle the error gracefully instead of crashing on the .Send command.