I need an Outlook Search Folder that finds e-mail by searching the sender or recipient's actual e-mail address. For example, if I want find all messages from senders in the domain example.com, I use the search criteria From… @example.com:
But the search only returns messages where @example.com
appears in the sender's Display Name (e.g. From: John Doe <john@example.com>). If the name doesn't contain their e-mail address, the e-mail doesn't appear in the search results.
How do I search for e-mails based on the actual To/From/CC e-mail address, even if the address is not present in the Display Name?
What I've tried:
- I've reviewed all the available fields on the Advanced tab. I see the "From", "To", etc. fields but they work the same way.
- I found this post, which suggests searching the Subject field and message body…but that is very unreliable.
- Google….but there's a billion results telling me how to do what I'm already doing.
Best Answer
It's possible to configure a Search Folder to find email based on the Sender's actual e-mail address (see below). However, it's not possible to expose the actual e-mail address for the To, Cc, or Bcc fields. An explanation of why can be found at the end of this answer.
Configure Search Folder to Search on Sender's Actual E-mail Address
Note: These instructions are written for Office 2013, but the solution should work for at least Outlook 2007 and later.
Step A: Add a Custom "Sender's Actual Address" Field to Outlook Using a Form
These steps create a custom form that adds a new field to Outlook with the sender's actual email address:
Save the following custom Outlook form configuration with the file name
FromEmailAddress.cfg
:Copy the
FromEmailAddress.cfg
to your language-specific Microsoft Office's Forms folder, located at:C:\Program Files (x86)\Microsoft Office\OfficeXX\FORMS\<LanguageID>
<OfficeXX>
is the Office folder including the version number (e.g.Office15
for Office 2013)<LanguageID>
is your 4-digit language ID (e.g.1033
for English).Note: Administrative rights are required to save files to this folder.
Note: Office may be installed in
C:\Program Files
if you have a 32-bit OS, or a 64-bit version of Office on a 64-bit OS.In Outlook, on the File tab of the ribbon click Options.
FromEmailAddress.cfg
file, select it, then click Open.Credit to this slipstick.com article for information on how to expose a sender's actual e-mail address as a field.
Step B: Use the Custom "From Email Address" Field in a Search Folder's Criteria
These steps leverage the newly created field as criteria for a Search Folder:
The Actual To, Cc, and Bcc E-Mail Addresses Can't Be Used as Criteria for Search Folders...
A thorough search of Outlook's other pre-defined fields, the MAPI fields available through Outlook's Object Model, and a review of properties exposed by OutlookSpy reveals there are no fields that expose these e-mail addresses as text. There is the PR_MESSAGE_RECIPIENTS property, but unfortunately this is an object that contains each recipient as a separate item. Accessed natively (using the Custom Form method above) returns nothing.
...With One Almost Useless Exception
Using the VBA from this slipstick.com article I was able to add a User Defined Field (UDF) to messages that contained a single string containing the recipient e-mail addresses in the format
john@example.com, jane@example.com
. However, when selecting a UDF in the Search Folder Advanced Criteria's Field list, only UDFs defined in the Inbox are available:If messages with the custom fields populated exist in the Inbox, they are found by the Search Folder. However, such messages located in other folders are not included in the results. Unless your Search Folder is only interested in the Inbox, this is rather useless.
Reasons why UDFs don't work in the criteria of a Search Folder are documented here, here and here.
The Pre-Defined Fields Are Still the "Best" Solution
When it comes to the To:, Cc:, and Bcc: fields, it's still best to use the pre-defined fields in your Search Folder criteria and hope the actual e-mail address is part of the Display Name (which it often is).