Create Search Folder that finds all external e-mails

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create an Outlook 2003 search folder that will find all
external e-mails (e-mails from outside my company's domain).

I want to create a query that finds everything NOT FROM *@mydomain.com

We are using Exchange 2003 in a Windows 2003 Active Directory domain
structure. All programs have the latest Service Packs applied.

Another thing I do not understand is that I posted this same question to
this USENET Discussion Community a couple weeks ago and it seems to have been
removed, I do not understand why my question was removed. It was named
"Outlook 2003 Search Folders" in the subject field.

I feel this query is a very tangible query that many Microsoft Domain Users
would appreciate utilizing, if possible...

Thank you,
Gregg A.
 
Try using the condition "sender's address does not contain @." Any senders inside your organization won't have SMTP addresses.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,

When I create a Custom Search Folder and go to the Advanced Tab of Search
Folder Criteria, then select the Field=FROM with a Condition=DOESN'T CONTAIN
and a VALUE=@
This query doesn't work, it finds and includes internal e-mails as well in
the Search Folder.

You say to try using "Sender's Address" and I do not see this as a Field to
query, so you've lost me. The best I can find is the "From" field as
mentioned above. Please be more specific with your replies by including
steps to this process you suggest...

Still trying to find solution.

Thank you again,
Gregg A.
 
Sorry, I was visualizing the Rules Wizard dialog not the Search Folder dialog.

What you want can be done, but not in the UI, because the field you need to work with isn't exposed in the UI. It can be done with code, however. This procedure, adapted from my latest book, creates a search folder for all mail from anyone outside the Exchange organization, that is anyone with a (e-mail address removed) address, by searching for addresses containing the @ character:

Sub MakeDomainSearchFolder()
SearchDomain = "@"
SearchSubfolders = True
'schemaFromName = "urn:schemas:httpmail:fromname"
schemaFromAddress = _
"http://schemas.microsoft.com/mapi/proptag/0x0065001f"

SearchDomain = "%" & SearchDomain & "%"
strSearch = Quote(schemaFromAddress) & _
" LIKE " & SQLQuote(SearchDomain)
Set olApp = CreateObject("Outlook.Application")
Set mySearch = olApp.AdvancedSearch _
("Inbox", strSearch, SearchSubfolders)
mySearch.Stop
Set myFolder = _
mySearch.Save("Messages from outside")
Set myFolder = Nothing
Set mySearch = Nothing
Set olApp = Nothing
End Sub


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top