Outlook Search MAPI Properties: How to Find Items by ‘PR_MESSAGE_CLASS’
🔍 WiseChecker

Outlook Search MAPI Properties: How to Find Items by ‘PR_MESSAGE_CLASS’

Outlook Search works well for finding emails by sender or subject but fails when you need to find items by a specific MAPI property like PR_MESSAGE_CLASS. This property stores the message type such as IPM.Note for standard email or IPM.Appointment for calendar items. Outlook’s built-in search does not expose MAPI properties directly in the search box. This article explains how to use DASL queries and Advanced Find to locate items by PR_MESSAGE_CLASS.

Key Takeaways: Searching Outlook Items by PR_MESSAGE_CLASS

  • Advanced Find (Ctrl+Shift+F): Enables searching by MAPI property using the DASL query syntax in the Search folder.
  • DASL query syntax “urn:schemas:httpmail:messageclass”: The exact property tag to filter by PR_MESSAGE_CLASS in Outlook search.
  • Search Folders with custom criteria: Persist your PR_MESSAGE_CLASS filter as a reusable Search Folder that updates automatically.

ADVERTISEMENT

Understanding PR_MESSAGE_CLASS and MAPI Properties in Outlook

PR_MESSAGE_CLASS is a MAPI property that identifies the type of an Outlook item. Each item class follows a naming convention defined by Outlook and third-party add-ins. Common values include IPM.Note for email messages, IPM.Appointment for calendar events, IPM.Contact for contacts, and IPM.Task for tasks. Custom forms and add-ins may register their own message classes such as IPM.Note.CustomForm or IPM.Post for discussion items.

Outlook stores this property internally but does not display it in the standard search interface. The search box matches against visible fields like subject, body, and sender name. To query PR_MESSAGE_CLASS, you must use DASL (DAV Search and Locating) syntax supported by Outlook’s Advanced Find dialog. DASL queries target the underlying MAPI namespace and can filter any property that Outlook exposes through its search provider.

The property tag for PR_MESSAGE_CLASS in DASL is urn:schemas:httpmail:messageclass. This string maps directly to the MAPI property 0x001A001F for string-type message classes. When you construct a DASL query, you compare this property against a specific message class value using operators such as EQ, LIKE, or CONTAINS.

Steps to Find Items by PR_MESSAGE_CLASS Using Advanced Find

Advanced Find is the built-in Outlook tool that supports DASL queries. Follow these steps to create a search filter by PR_MESSAGE_CLASS.

  1. Open Advanced Find
    Press Ctrl+Shift+F on your keyboard. The Advanced Find dialog appears with a Search tab and a Browse tab.
  2. Switch to the Advanced tab
    Click the Advanced tab in the Advanced Find dialog. This tab contains the Fields, Condition, and Value controls for building a DASL query.
  3. Define the MAPI property field
    Click the Field button and select All Mail Fields > Message Class if it appears in the list. If Message Class is not visible, choose User-defined fields in folder > New Field. In the Name box type PR_MESSAGE_CLASS, set Type to Text, and click OK.
  4. Set the condition and value
    In the Condition dropdown, select contains or is (exactly). For exact matches choose is (exactly). In the Value box type the message class string such as IPM.Appointment. Click Add to List.
  5. Run the search
    Click Find Now at the top of the dialog. Outlook searches the currently selected folder and displays matching items in the results pane below.

To search across all folders, select All Mail and Post Items from the Look dropdown before running the search. The Advanced tab supports multiple conditions combined with And/Or logic for complex filters.

Using a DASL Query Directly in Advanced Find

If the Message Class field does not appear, you can enter a DASL query manually. On the Advanced tab, click Field > All Mail Fields > Message and then type the DASL property string into the Value box. Use this format:

urn:schemas:httpmail:messageclass LIKE '%IPM.Note%'

Replace IPM.Note with the class you want to find. The LIKE operator with percent signs matches any message class containing that substring. For an exact match, remove the percent signs and use:

urn:schemas:httpmail:messageclass = 'IPM.Appointment'

ADVERTISEMENT

Creating a Persistent Search Folder for PR_MESSAGE_CLASS

Search Folders let you save a DASL query so Outlook automatically populates the folder with matching items. This is useful for ongoing monitoring of specific message classes.

  1. Create a new Search Folder
    Go to Folder > New Search Folder in the ribbon. Scroll to the bottom of the list and select Create a custom Search Folder. Click Choose.
  2. Name the folder
    In the Custom Search Folder dialog, type a descriptive name such as Appointment Items.
  3. Define criteria
    Click Criteria and go to the Advanced tab. Follow the same steps as Advanced Find to add the PR_MESSAGE_CLASS condition. Click OK to save.
  4. Select folders to search
    In the Custom Search Folder dialog, click Browse to choose which folders the Search Folder monitors. Select your mailbox and any subfolders. Click OK twice.

The Search Folder appears under Search Folders in the folder pane. Outlook updates it automatically as new items arrive or change.

Common Issues When Searching by PR_MESSAGE_CLASS

Advanced Find returns no results even though items exist

The most common cause is an incorrect message class string. Verify the exact class name by opening an item and running a VBA macro to read its PR_MESSAGE_CLASS property. Alternatively, use OutlookSpy or MFCMAPI to inspect the property value. Also confirm that the folder you are searching contains items of that class. A calendar folder will not contain IPM.Note items.

Message Class field does not appear in the Field list

Outlook hides certain MAPI properties from the Field picker. Create a user-defined field named PR_MESSAGE_CLASS as described in the steps above. The field maps to the correct MAPI property when you add it.

Search Folder does not update after adding new items

Indexing delays can cause a Search Folder to appear empty. Wait for Windows Search to finish indexing. To force an update, right-click the Search Folder and select Update Folder. If the problem persists, rebuild the search index from File > Options > Search > Indexing Options > Advanced > Rebuild.

Item Advanced Find (One-Time Search) Search Folder (Persistent)
Description Temporary filter using Ctrl+Shift+F Saved query that updates automatically
Setup time Less than 2 minutes 5 minutes with folder selection
Reusability Must recreate each time Persists until deleted
Best for Ad-hoc investigations Ongoing monitoring of message classes
DASL query method Manual entry or field picker Criteria dialog Advanced tab

Searching by PR_MESSAGE_CLASS gives you precise control over which Outlook item types appear in your results. Use Advanced Find for one-time queries and Search Folders for recurring filters. You can extend the same technique to other MAPI properties like PR_SENDER_NAME or PR_SUBJECT by using their corresponding DASL tags. For advanced automation, consider writing a VBA macro that runs a DASL filter on a timer or in response to a folder change event.

ADVERTISEMENT