New Outlook Documentation Part 3 – Detecting Header Items

[This is now documented here:]

[This information was also published as]

This one jumped ahead in the line because Oliver Seaman was asking me about detecting which items are headers. Next post should be about dealing with IMAP header messages.

A property to identify items in header only state

Both Cached Exchange mode and IMAP support the concept of header items. Messages in the Cached Exchange OST and in the IMAP PST can be in one of two states: a message in its entirety with the header and body, or a message with only its header downloaded.

This property can be used to determine the current state of a message.

Note: this property does not apply to remote transport headers, which can be distinguished by the message class “IPM.Remote”.


#define dispidHeaderItem 0x8578
DEFINE_OLEGUID(PSETID_Common, MAKELONG(0x2000+(8),0x0006),0,0);


This is a named property of type PT_LONG which will be present and non-zero on a message if the message is a header.

BOOL bIsHeader(LPMESSAGE lpMessage)
	HRESULT         hRes = S_OK;
	BOOL            bRet = false;
	ULONG           ulVal = 0;
	LPSPropValue    lpPropVal = NULL;
	LPSPropTagArray lpNamedPropTag = NULL;
	MAPINAMEID      NamedID = {0};

	NamedID.lpguid = (LPGUID) &PSETID_Common;
	NamedID.ulKind = MNID_ID;
	NamedID.Kind.lID = dispidHeaderItem;
	lpNamedID = &NamedID;

	hRes = lpMessage->GetIDsFromNames(1, &lpNamedID, NULL, &lpNamedPropTag);

	if (lpNamedPropTag && 1 == lpNamedPropTag->cValues)
		lpNamedPropTag->aulPropTag[0] = CHANGE_PROP_TYPE(lpNamedPropTag->aulPropTag[0], PT_LONG);

		//Get the value of the property.
		hRes = lpMessage->GetProps(lpNamedPropTag, 0, &ulVal, &lpPropVal);
		if (lpPropVal && 1 == ulVal && PT_LONG == PROP_TYPE(lpPropVal->ulPropTag) && lpPropVal->Value.ul)
			bRet = true;
	return bRet;

[Update: Added KB link]

Comments (3)

  1. Petr Prazak says:

    This is a great info.

    Is this property also available on previous versions of Outlook (2000, XP) ? If not, is there a way to detect headers there?

  2. We’re only providing support for it as of Outlook 2003, but the property should be available on the older clients as well.

  3. Russ Purinton says:

    I am hoping that you can help with a problem I’ve been having. Lately, I’ve been receiving email that has an attachement only and no message at all in the body of the email. The attachment is usually a .pdf file whose message is to try to get me to buy various kinds of stock. My question is: Is it possible to set up some kind of rule in Outlook that checks to see if the body of the message contains "nothing" or is as I would say "null" and if it does contain nothing, delete it?

    If this is something I should not be addressing to you here, l would like to apologize now. I have been searching for some time now for an answer to this question and based on what I read in this post, I thought if anyone would know how to do something like this, it would probably be you. If you are so inclined and wouldn’t mind sending a response to my email address, here it is:

    Thankyou for listening – Russ Purinton

Skip to main content