MAPI Data Types

There are three user-defined data types necessary to use MAPI:

MAPIMessage defines the structure of an actual mail message including its text, subject, and date:


Type MapiMessage
    Reserved As Long
    Subject As String
    NoteText As String
    MessageType As String
    DateReceived As String
    ConversationID As String
    Flags As Long
    RecipCount As Long
    FileCount As Long
End Type

MAPIRecip defines a recipient (addressee) of a message including the name and address:


Type MapiRecip
    Reserved As Long
    RecipClass As Long
    Name As String
    Address As String
    EIDSize As Long
    EntryID As String
End Type

MAPIFile defines a file attachment to a message including the filename, the name as it appears in the message, and its position in the message.


Type MapiFile
    Reserved As Long
    Flags As Long
    Position As Long
    PathName As String
    FileName As String
    FileType As String
End Type