Overview

MAPI defines methods for attaching messages, links to files, and files to other messages. It does not define methods for attaching folders or for attaching links to messages. The Microsoft Exchange Client has defined its own methods for attaching links to folders and links to messages. This document explains how to create attachments in a message that the Microsoft Exchange Client version 4.0 will recognize as links to folders or messages. Other MAPI clients, as well as future versions of the Microsoft Exchange Client, may not be compatible with links built according to the information supplied here.

A folder link is an attached file in a specific format; its name must end with the extension .XNK. Microsoft Exchange designates itself as the handler for this file extension when it is installed. An .XNK file contains two kinds of information. First, there is the path to the folder, which is a list of entry identifiers: the entry identifiers of the folder, all its parent folders, and the message store in which it resides. Then there is display information: the position, size, and display elements present in a Microsoft Exchange viewer. Together, this gives Microsoft Exchange all the information needed to display the folder. Folder links may be placed in the filesystem, or attached to a message by value like any file. The exact structure of the attachment is defined in _LINKS.H.

A message link is a structured storage object. Message links can be attached to other messages, but not placed in the filesystem. Within the structured storage are four or five streams, each containing one piece of information, including: the entry identifiers of the message, its parent folder, and the message store in which it resides; the subject of the message; and a metafile used to portray the link in the outer message (this one is optional). The storage also contains the CLSID of an OLE server implemented by Microsoft Exchange, that can interpret the storage and launch a viewer on the linked message. The stream names and CLSID are defined in MSGLINK.CPP; in summary:

MailMsgAttMdb
MailMsgAttFld
MailMsgAttMsg
MailMsgAttSubject
MailMsgAttIcon