Fix Outlook Error 80004005: Outlook Does Not Recognize One or More Names in VBA
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.

- 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.
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.
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.
Press ALT + F11 to open the Visual Basic for Applications (VBA) editor and locate the module containing your email generation script.
Find the section of your code where the Outlook MailItem properties are defined (usually starting with 'With obj_OL_MailItem').
Immediately before the '.Send' command, insert a new line and type '.Recipients.ResolveAll'.
Save your code changes and run the macro again to verify that the previously problematic email addresses are now processed correctly.

Define Recipients Using the .Recipients.Add Method
Bypass the standard .To property by adding recipients directly to the Recipients collection before resolving them.
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.

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.




