MapiFileDesc structure (mapi.h)
A MapiFileDesc structure contains information about a file containing a message attachment stored as a temporary file. That file can contain a static OLE object, an embedded OLE object, an embedded message, and other types of files. For Unicode support, use the MapiFileDescW structure.
Syntax
typedef struct {
ULONG ulReserved;
ULONG flFlags;
ULONG nPosition;
LPSTR lpszPathName;
LPSTR lpszFileName;
LPVOID lpFileType;
} MapiFileDesc, *lpMapiFileDesc;
Members
ulReserved
Reserved; must be zero.
flFlags
Bitmask of option flags. The following flags can be set.
If neither flag is set, the attachment is treated as a data file.
nPosition
An integer used to indicate where in the message text to render the attachment. Attachments replace the character found at a certain position in the message text. That is, attachments replace the character in the MapiMessage structure field NoteText[nPosition]. A value of -1 (0xFFFFFFFF) means the attachment position is not indicated; the client application will have to provide a way for the user to access the attachment.
lpszPathName
Pointer to the fully qualified path of the attached file. This path should include the disk drive letter and directory name.
lpszFileName
Pointer to the attachment filename seen by the recipient, which may differ from the filename in the lpszPathName member if temporary files are being used. If the lpszFileName member is empty or NULL, the filename from lpszPathName is used.
lpFileType
Pointer to the attachment file type, which can be represented with a MapiFileTagExt structure. A value of NULL indicates an unknown file type or a file type determined by the operating system.
Remarks
Simple MAPI works with three kinds of embedded attachments:
- Data file attachments
- Editable OLE object file attachments
- Static OLE object file attachments
OLE object files are file representations of OLE object streams. The client application can re-create an OLE object from the file by calling the OLE function OleLoadFromStream with an OLESTREAM object that reads the file contents. If an OLE file attachment is included in an outbound message, the OLE object stream should be written directly to the file used as the attachment.
When using the MapiFileDesc member nPosition, the client application should not place two attachments in the same location. Client applications might not display file attachments at positions beyond the end of the message text.
Requirements
Requirement | Value |
---|---|
Header | mapi.h |