LazyMAPI

IMIEMTypes

unit: IMIEMTypes.pas
file path: ..\Library\
version: 2014.хх

Available declarations:

 TMAPIObjType = (omUndefined, omSTORE, omADDRBOOK, omFOLDER, omABCONT, omMESSAGE, omMAILUSER, omATTACH, omDISTLIST, omPROFSECT, omSTATUS, omSESSION, omFORMINFO);

description
Identifies type of MAPI object:

 omUndefined - Undefined Object
 omSTORE - Message store object. Acts as a hierarchically organized database of messages.
 omADDRBOOK - Address book object. Provides access to the integrated view of recipient information that belongs to all of the address book providers in the active profile.
 omFOLDER - Folder object. Contains messages and other message containers.
 omABCONT - Address book container object. Contains recipient information for one address book provider in the active profile; address book providers can have one or more address book containers.
 omMESSAGE - Message object. Contains information that can be sent to one or more recipients.
 omMAILUSER - Messaging user object. Describes an individual recipient of a message.
 omATTACH - Message attachment object. Contains additional data, such as a file or OLE object, to be associated with a message.
 omDISTLIST - Distribution list object. Describes a grouping of individual message recipients.
 omPROFSECT - Profile section object. A part of a profile used to describe a particular message service or service provider.
 omSTATUS - Status object. Provides access to the service provider's state.
 omSESSION - Session object. Represents a connection to underlying messaging systems and provides clients with access to MAPI resources.
 omFORMINFO - Form object. Controls the display and operation of a custom form for viewing messages of a specific class.  


 TMAPIFldType = (oFolderInbox, oFolderDeletedItems, oFolderOutbox, oFolderSentMail, oFolderCalendar, oFolderContacts, oFolderDrafts, oFolderJournal, oFolderNotes, oFolderTasks, oFolderJunk, oFolderRSSFeeds, oFolderSearchRoot, oFolderUndefined, oFolderSyncIssues, oFolderConflicts, oFolderLocalFailures, oFolderServerFailures, oFoldersMax);

description
Identifies type of MAPI folder:

 oFolderInbox - The Inbox folder.
 oFolderDeletedItems - The Deleted Items folder.
 oFolderOutbox - The Outbox folder.
 oFolderSentMail -  The Sent Mail folder.
 oFolderCalendar - The Calendar folder.
 oFolderContacts - The Contacts folder.
 oFolderDrafts - The Drafts folder.
 oFolderJournal - The Journal folder.
 oFolderNotes - The Notes folder.
 oFolderTasks - The Tasks folder.
 oFolderJunk - The Junk E-Mail folder.
 oFolderRSSFeeds - The RSS Feeds folder.
 oFolderSearchRoot - The Search folder. Search folders do not physically contain messages, they only contain links to the messages in the folders where the search is performed.
 oFolderSyncIssues - The Sync Issues folder. Only available for an Exchange account.
 oFolderConflicts - The Conflicts folder (subfolder of Sync Issues folder). Only available for an Exchange account.
 oFolderLocalFailures - The Local Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account.
 oFolderServerFailures - The Server Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account. 


TMAPIRecipientType = (rtUnspecified, rtTo, rtCC, rtBCC);

description
Identifies type of MAPI Recipient:
 
 rtTo - Recipient is a primary recipient
 rtCC - Recipient is a copy recipient
 rtBCC - Recipient is blind copy recipient


TMsgType = (oUnknown, oMessage, oAppointment, oContact, oDistList, oTask, oJournal, oStickyNote, oPost);

description
Identifies type of MAPI Message:

 oMessage - Message class "IPM.Note" - E-mail messages
 oAppointment - Message class "IPM.Appointment" - Appointments
 oContact - Message class "IPM.Contact" - Contacts
 oDistList - Message class "IPM.DistList" - Distribution lists
 oTask - Message class "IPM.Task" - Tasks
 oJournal - Message class "IPM.Activity" - Journal entries
 oStickyNote - Message class "IPM.StickyNote" - Note
 oPost - Message class "IPM.Post" - Notes in a folder


 TMsgBodyType = (aUndefined, aPlain, aRTF, aHTML, aRtfToHml);
 TBodyType = TMsgBodyType;

description
Contains a value that indicates the message best body format:

 aPlain - The body is plain text
 aRTF - The body is RTF (Rich Text Format)
 aHTML - The body is HTML
 aRtfToHml - The body is HTML saved as RTF


 TMsgHead = record
    ID: TBytes; // PR_ENTRYID (Message Unique ID)
    MsgType: TMsgType; // Message, Appointment, Contact, etc..
    HasAttachment: Boolean; // PR_HASATTACH
    Subject: string; // PR_SUBJECT
    Sender: string; // PR_SENDER_NAME
    SentTime: TDateTime; // PR_CLIENT_SUBMIT_TIME
    Size: Cardinal; // PR_MESSAGE_SIZE
    Flags: Cardinal; // PR_MESSAGE_FLAGS
    IconIndex: integer; // PR_ICON_INDEX
    ItemIndex: integer; // message position inside content table
end;

PMsgHead = ^TMsgHead;
TMsgHeadList = array of TMsgHead;

description
Contains the most commonly used properties of the MAPI message


 TStoreType = (stUndefined, stExchangePrivate, stExchangeDelegate, stExchangePublic, stLocalPersonal);
 TMsgStoreType = type TStoreType;

description
 Identifies type of MAPI Message Store:

 stExchangePrivate - Microsoft Exchange Private Store
 stExchangeDelegate -  Microsoft Exchange Private Store (delegate mailbox)
 stExchangePublic - Microsoft Exchange Public Store (for public folders)
 stLocalPersonal -  Store for Personal Folders files (.PST)


 TFolderHead = record
    ID: TBytes; // PR_ENTRYID (Folder Unique ID)
    DisplayName: string; // PR_DISPLAY_NAME
    FolderClass: string; // PR_CONTAINER_CLASS
    FolderType: TMAPIFldType; // Mapping PR_CONTAINER_CLASS to enumeration
    MsgCount: Cardinal; // PR_CONTENT_COUNT
    UnReadMsgCount: Cardinal; // PR_CONTENT_UNREAD
    HasSubFolders: Boolean; // PR_SUBFOLDERS
    ParentID: TBytes; // PR_PARENT_ENTRYID
    StoreID: TBytes; // PR_STORE_ENTRYID
    StoreType: TMsgStoreType; //Store type enumeration as "Local", "Public", etc.
    Hidden: Boolean; // Specifies the hide or show status of a folder.
end;

PFolderHead = ^TFolderHead;
TFoldersHeadList = array of TFolderHead;

description
 Contains the most commonly used properties of the MAPI Folder


 TStoreHead = record
    ID: TBytes; // PR_ENTRYID(Store Unique ID)
    DisplayName: string; // PR_DISPLAY_NAME
    ProviderDisplayName: string; // PR_PROVIDER_DISPLAY_NAME
    IsDefault: Boolean; // PR_DEFAULT_STORE
    StoreType: TMsgStoreType; //Store type enumeration as "Local", "Public", etc.
end;

PStoreHead = ^TStoreHead;
TStoresHeadList = array of TStoreHead;

description
 Contains the most commonly used properties of the MAPI Store


 TRecipientHead = record
    DisplayName: string; // PR_DISPLAY_NAME
    EMailAddress: string; // PR_EMAIL_ADDRESS
    AddressType: string; // PR_ADDRTYPE
    RecipientType: TMAPIRecipientType; // PR_RECIPIENT_TYPE enumeration
end;

PRecipientHead = ^TRecipientHead;
TRecipientsHeadList = array of TRecipientHead;

description
Contains the most commonly used properties of the MAPI Recipient



TMsgImportance = (miLow, miNormal, miHigh);

description
 Contains a value that indicates the message sender's opinion of the importance of a message (PR_IMPORTANCE)

  miLow - The message has low importance.
  miNormal - The message has normal importance.
  miHigh - The message has high importance.



TAttMethod = (amNoAttachment, amByValue, amByReference, amByRefResolve, amByRefOnly, amEmbeddedMsg, amOLE);

description
 Representing the way the contents of an attachment can be accessed (PR_ATTACH_METHOD)

 amNoAttachment - The attachment has just been created.
 amByValue - The PR_ATTACH_DATA_BIN (PidTagAttachDataBinary) property contains the attachment data.
 amByReference - The PR_ATTACH_PATHNAME (PidTagAttachPathname) or PR_ATTACH_LONG_PATHNAME (PidTagAttachLongPathname) property contains a fully-qualified path identifying the attachment to recipients with access to a common file server.
 amByRefResolve - The PR_ATTACH_PATHNAME or  PR_ATTACH_LONG_PATHNAME property contains a fully-qualified path identifying the attachment.
 amByRefOnly - The PR_ATTACH_PATHNAME or  PR_ATTACH_LONG_PATHNAME property contains a fully-qualified path identifying the attachment
 amEmbeddedMsg - The PR_ATTACH_DATA_OBJ (PidTagAttachDataObject) property contains an embedded object that supports the Imessage interface.
 amOLE - The attachment is an embedded OLE object.  When the OLE object is in OLE 2.0 Istorage format, the data is accessible through PR_ATTACH_DATA_OBJ. When the OLE object is in OLE 1.0 OLESTREAM format, the data is accessible through PR_ATTACH_DATA_BIN as an Istream. The type of the OLE encoding can be determined by the PR_ATTACH_TAG (PidTagAttachTag) value.


TAttHead = record
    ID: Cardinal; // PR_ATTACH_NUM
    DisplayName: string; // PR_DISPLAY_NAME
    FileName: string; // PR_ATTACH_FILENAME
    Size: Cardinal; // PR_ATTACH_SIZE
    Method: TAttMethod; // PR_ATTACH_METHOD
    Hidden: Boolean; // PR_ATTACHMENT_HIDDEN
    Flags: Cardinal; // PR_ATTACH_FLAGS
end;

PAttHead = ^TAttHead;
TAttHeadList = array of TAttHead;

description
 Contains the most commonly used properties of the MAPI Attachement


TStickyNoteColor = (osncBlue, osncGreen, osncPink, osncYellow, osncWhite);

description
  Suggested background color of the Note object (PidLidNoteColor)

  osncBlue - Blue
  osncGreen - Green
  osncPink - Pink
  osncYellow - Yellow
  osncWhite - White


TContactGender = (olUnspecified, olFemale, olMale);

description
 Contains a value that indicates the contact gender (PR_GENDER)

Name Value Description
olUnspecified 0 Unspecified gender
olFemale 1 Female
olMale 2 Male

TContactPhysicalAddress = (olNone, olHome, olBusiness, olOther);

description
 Indicates the address to use as the the mailing address. (PidLidContactItemData)

Name Value Description
olNone 0 No mailing address defined
olHome 1 Home mailing address
olBusiness 2 Business mailing address
olOther 3 Other mailing address

TMsgSensitivity = (olNormal, olPersonal, olPrivate, olConfidential);

description
  Represents the sensitivity for the mail item. (PR_SENSITIVITY)

Name Value Description
olNormal 0 Normal sensitivity
olPersonal 1 Personal
olPrivate 2 Private
olConfidential 3 Confidential

TRemoteStatus = (olRemoteStatusNone, olUnMarked, olMarkedForDownload, olMarkedForCopy, olMarkedForDelete);

description
 Indicates the status of an item after it is received by a remote user. (PidLidRemoteStatus)

Name Value Description
olRemoteStatusNone 0 No remote status has been set.
olUnMarked 1 Item is not marked.
olMarkedForDownload 2 Item is marked for download.
olMarkedForCopy 3 Item is marked to be copied.
olMarkedForDelete 4 Item is marked for deletion.

TBusyStatus = (olFree, olTentative, olBusy, olOutOfOffice, olWorkingFromElsewhere);

description
 Indicates a user's availability. (PidLidBusyStatus)

Name Value Description
olFree 0 The user is available.
olTentative 1 The user has a tentative appointment scheduled.
olBusy 2 The user is busy.
olOutOfOffice 3 The user is out of office.

TMeetingStatus = (olNonMeeting = $00000000, olMeeting = $00000001, olMeetingReceived = $00000003, olMeetingCanceledOld = $00000004,
olMeetingCanceled = $00000005, olMeetingReceivedAndCanceled = $00000007);

description
 Indicates the status of the meeting. (PidLidAppointmentStateFlags)


TResponseStatus = (olResponseNone, olResponseOrganized, olResponseTentative, olResponseAccepted, olResponseDeclined, olResponseNotResponded);

description
 Indicates the response to a meeting request. (PidLidResponseStatus)

Name Value Description
olResponseNone 0 The appointment is a simple appointment and does not require a response.
olResponseOrganized 1 The Appointment is on the Organizer's calendar or the recipient is the Organizer of the meeting.
olResponseTentative 2 Meeting tentatively accepted.
olResponseAccepted 3 Meeting accepted.
olResponseDeclined 4 Meeting declined.
olResponseNotResponded 5 Recipient has not responded.

 TTaskDelegationState = (olTaskNotDelegated, olTaskDelegationUnknown, olTaskDelegationAccepted, olTaskDelegationDeclined);

description
 Indicates the delegation state of a task. (PidLidTaskAcceptanceState)

Name Value Description
olTaskNotDelegated 0 The task has not been delegated.
olTaskDelegationUnknown 1 The delegate response to the task is unknown.
olTaskDelegationAccepted 2 The delegate accepted the task.
olTaskDelegationDeclined 3 The delegate declined the task.

 TTaskOwnership = (olNewTask, olDelegatedTask, olOwnTask);

description
 Indicates the ownership state of the task. (PidLidTaskOwnership)

Name Value Description
olNewTask 0 Task has not yet been assigned to a user.
olDelegatedTask 1 Task has been delegated to another user.
olOwnTask 2 Task is assigned to the current Outlook user.

TContactEmailType = (olEmailUnMarked, olEmail1, olEmail2, olEmail3);

description
 Indicates type of Contact email address. (PidLidContactItemData)

  olEmail1 - The application should display Email1.
  olEmail2 - The application should display Email2.
  olEmail3 - The application should display Email3.


TContactTelephones = (olcPrimary, olcHome, olcHome2, olcHomeFax, olcBusiness, olcBusiness2, olcBusinessFax, olcCompany, olcAssistant, olcMobile, olcRadio, olcCar, olcPager, olcCallback, olcTTYTDD, olcTelex, olcISDN, olcOther, oclOtherFax);

description
  Indicates type of Contact Telephone.

Name Description
olcPrimary The primary telephone number for the contact.
olcHome The first home telephone number for the contact.
olcHome2 The second home telephone number for the contact.
olcBusiness Tthe first business telephone number for the contact.
olcBusiness2 The second business telephone number for the contact.
olcCompany The company main telephone number for the contact.
olcAssistant The telephone number of the person who is the assistant for the contact.
olcMobile The mobile telephone number for the contact.
olcRadio The radio telephone number for the contact.
olcCar The car telephone number for the contact.
olcPager The pager number for the contact.
olcCallback The callback telephone number for the contact.
olcTTYTDD The TTY/TDD telephone number for the contact.
olcTelex The telex number for the contact.
olcISDN The ISDN number for the contact.
olcOther The other telephone number for the contact.

TContactNames = (olGiven, olMiddle, olSurname, olNickname, olGeneration, olDisplayNamePrefix, olInitials, olDisplayName);

description
  Indicates type of Contact Name.

Name Description
olGiven The first name for the contact.
olMiddle The middle name for the contact.
olSurname The last name for the contact.
olNickname The nickname for the contact.
olGeneration The name suffix (such as Jr., III, or Ph.D.) for the specified contact.
olDisplayNamePrefix The title for the contact.
olInitials The initials for the contact.
olDisplayName The whole, unparsed full name for the contact.

TContactProfessional = (olJobTitle, olCompany, olDepartment, olOffice, olManager, olAssistant, olProfession, olOrgID);

description
 Indicates type of professional property.

Name Description
olJobTitle The job title for the contact.
olCompany The company name for the contact.
olDepartment The department name for the contact.
olOffice The specific office location (for example, Building 1 Room 1 or Suite 123) for the contact.
olManager The manager name for the contact.
olAssistant The name of the person who is the assistant for the contact.
olProfession The profession for the contact.
olOrgID The organizational ID number for the contact.

TPDLMemberAddrType = (odlmUndefined, odlmEmail1, odlmEmail2, odlmEmail3, odlmHomeFax, odlmBusinessFax, odlmOtherFax);

description
  Indicates Adress Type for Member of Private Distribution List.


TPDLMemberType = (odlmOneOff, odlmContact, odlmPersonalDList, odlmGALMailUser, odlmGALDList);

description
  Indicates Member Type of Private Distribution List.


TDListMember = record
    AddressType: String;  // PR_ADDRTYPE
    EMailAddress: string;  // PR_EMAIL_ADDRESS
    DisplayName: string;  // PR_DISPLAY_NAME
    MemberType: TPDLMemberType;
    EntryID: TBytes;  // PR_ENTRYID
end;

TDListMembers = array of TDListMember;

description

  Contains the most commonly used properties of the MAPI Personal Distribution List Member.


TRecurrenceType = (oRecursNone = -1, oRecursDaily = $00000000, oRecursWeekly = $00000001, oRecursMonthly = $00000002, oRecursMonthNth = $00000003,
oRecursMonthEnd = $00000004, oRecursYearly = $00000005, oRecursYearNth = $00000006);

description
 Indicates type of recurrences (for example - an appointment recurrence).

Name Description
oRecursNone No recurrence.
oRecursDaily Every N number of days
oRecursWeekly Every weekday or Every N weeks on one or more particular days of the week
oRecursMonthly On the Nth day of every X month
oRecursMonthNth On a specific day of the week on the first, second, third, fourth, or last week of every month
oRecursMonthEnd Not used.
oRecursYearly On the Mth day of the Nth month, of every X year
oRecursYearNth On any day of the week on the first, second, third, fourth, or last week of the Nth month, of every year X year

TABUserType = (dtMailUser, dtDistList, dtForum, dtAgent, dtOrganization, dtPrivateDistList, dtRemoteMailUser, dtRoom, dtEquipment, dtSecDistList);
TABUserTypes = set of TABUserType;

description
  Indicates display type of Address Book entry object (PR_DISPLAY_TYPE

Name Description
dtMailUser User with a mailbox
dtDistList Distribution list
dtForum Public or shared folder
dtAgent An automated agent, such as Quote-Of-The-Day or Dynamic distribution list
dtOrganization A special alias defined for a large group, such as helpdesk, accounting
dtPrivateDistList A private, personally administered distribution list
dtRemoteMailUser A recipient known to be from a foreign or remote messaging system
dtRoom Conference room
dtEquipment Equipment, for example, a printer or a projector
dtSecDistList Security distribution list

TABContType = (dtModifiable, dtGlobal, dtLocal, dtWan, dtNotSpecific);

description
  Indicates display type of Address Book container  (PR_DISPLAY_TYPE)

Name Description
dtModifiable Modifiable; the container should be denoted as modifiable
dtGlobal A global address book
dtLocal A local address book
dtWan A wide area network address book
dtNotSpecific Does not match any of the other settings

TMsgActionType = (faShow, faPrint, faSaveAs, faReply, faReplyToAll, faForward);

description
  Standard verbs, or actions for MAPI form viewers

Name Description
faShow Open and show
faPrint Print
faSaveAs Save
faReply Reply
faReplyToAll Reply to all
faForward Forward Message

TValidFoldersMask = (vfInbox, vfOutbox, vfSentMail, vfWasteBasket, vfCalendar, vfContacts, vfJournal, vfNotes, vfTasks, vfDrafts, vfCommonViews, vfFinder, vfSubtree, vfViews);
TValidFolders = set of TValidFoldersMask;

description
 Indicate the validity of the entry identifiers of the folders in a message store (PR_VALID_FOLDER_MASK)

Name Description
vfInbox The interpersonal message (IPM) receive folder has a valid entry identifier
vfOutbox The IPM Outbox folder has a valid entry identifier
vfSentMail The IPM Sent Items folder has a valid entry identifier
vfWasteBasket The IPM Deleted Items folder has a valid entry identifier
vfCalendar The IPM Calendar folder has a valid entry identifier
vfContacts The IPM Contacts folder has a valid entry identifier
vfJournal The IPM Journal folder has a valid entry identifier
vfNotes The IPM Notes folder has a valid entry identifier
vfTasks The IPM Tasks folder has a valid entry identifier
vfDrafts The IPM Drafts folder has a valid entry identifier
vfCommonViews The common views folder has a valid entry identifier
vfFinder The finder folder has a valid entry identifier
vfSubtree The IPM folder subtree has a valid entry identifier
vfViews The views folder has a valid entry identifier

TAccessLevel = (alReadOnly, alReadWrite, alBestAccess);

description
 Indicates the client's access level to the MAPI object (PR_ACCESS_LEVEL)

Name Description
alReadOnly Read-Only
alReadWrite Modify
alBestAccess Requests that the object be opened by using the maximum network permissions allowed for the user and the maximum client application access

TAccessControl = (acWrite, acRead, acDelete, acHierarchy, acContent, acAssociated);
TAccessControlSet = set of TAccessControl;

description
 Indicates the operations that are available to the client for the MAPI object (PR_ACCESS)

Name Description
acWrite Write
acRead Read
acDelete Delete
acHierarchy Create subfolders in the folder hierarchy
acContent Create content messages
acAssociated Create associated content messages

TStoreSupports = (stsAnsi, stsAttach, stsCategorize, stsCreate, stsEntryIdUnique, stsHTML, stsITEMPROC, stsLocal, stsModify, stsMVProps, stsNotify, stsOLE, stsPublic, stsPusher, stsReadOnly, stsRestriction, stsRTF, stsRules, stsSearch, stsSort, stsSubmit, stsUncompressedRTF, stsUnicode);
TStoreSupportsSet = set of TStoreSupports;

description
  Indicates the capabilities of a message store to client applications. (PR_STORE_SUPPORT_MASK)

Name Description
stsAnsi The message store supports properties that contain ANSI (8-bit) characters
stsAttach The message store supports attachments (OLE or non-OLE) to messages
stsCategorize The message store supports categorized views of tables
stsCreate The message store supports creation of new messages
stsEntryIdUnique Entry identifiers for the objects in the message store are unique, that is, never reused during the life of the store
stsHTML The message store supports HTML messages, stored in the PR_BODY_HTML (PidTagBodyHtml) property
stsITEMPROC In a wrapped PST store, indicates that when a new message arrives at the store, the store performs rules and spam filter processing on the message separately
stsLocal Reserved. Should not be used.
stsModify The message store supports modification of its existing messages
stsMVProps The message store supports multivalued properties, guarantees the stability of value order in a multivalued property throughout a save operation, and supports instantiation of multivalued properties in tables
stsNotify The message store supports notifications
stsOLE The message store supports OLE attachments. The OLE data can be accessed through an IStorage interface, such as that available through the PR_ATTACH_DATA_OBJ (PidTagAttachDataObject) property
stsPublic The folders in this store are public (multi-user), not private (possibly multi-instance but not multi-user)
stsPusher The MAPI Protocol Handler will not crawl the store, and the store is responsible for pushing any changes through notifications to the indexer to have messages indexed
stsReadOnly All interfaces for the message store have a read-only access level
stsRestriction The message store supports restrictions
stsRTF The message store supports Rich Text Format (RTF) messages, usually compressed, and the store itself keeps PR_BODY and PR_RTF_COMPRESSED synchronized
stsRules Indicates that rules should be stored in this PST store even if it is not the default store
stsSearch The message store supports search-results folders
stsSort The message store supports sorting views of tables
stsSubmit The message store supports marking a message for submission
stsUncompressedRTF The message store supports storage of RTF messages in uncompressed form. An uncompressed RTF stream is identified by the value dwMagicUncompressedRTF in the stream header
stsUnicode Indicates that the message store supports Unicode storage. A client can look for the presence of the flag to decide whether to request or to save Unicode information to the store

TPSTEncryption = (psteNoEncrypt, psteCompressEncrypt, psteBestEncrypt);

description
  Type of PST Encryption

Name Description
psteNoEncrypt No Encryption
psteCompressEncrypt Compress Encryption
psteBestEncrypt Best Encryption

POutlookNamedProp = ^TOutlookNamedProp;
TOutlookNamedProp = record
  ID: Integer;
  KIND: Byte;
  PROP_ID: WORD;
  PROP_NAME: PWideChar;
  GUID_ID: PGUID;
  PID_NAME: PWideChar;
  PROP_TYPE: WORD;
end;

TOutlookNamedPropList = array of TOutlookNamedProp;

description
  Custom MAPINAMEID structure. See included MAPINamed.inc for more information

fields

   ID: Integer - Ordinal ID, as  Ord(idNameCalendarBusystatus)
  KIND: Byte - MNID_ID or MNID_STRING;  When is MNID_ID the PROP_ID member contains an integer value that represents the property name. When is MNID_STRING the PROP_NAME member contains a Unicode character string representing the property name
  PROP_ID: WORD -  contains an integer value that represents the property name, as $2328
  PROP_NAME: PWideChar - contains a Unicode character string representing the property name, as 'Keywords'
  GUID_ID: PGUID -  Pointer to a TGUID structure defining a particular property set; this member cannot be nil
  PID_NAME: PWideChar -  contains a string "representation" (canonical name) of common named property as 'PidNameKeywords'
  PROP_TYPE: WORD - The property type of this NAMED property


TMAPINamedArea = (naPublic, naUnified, naMessaging, naReport, naSharing, naCalendarAssistant, naTasks, naRemote, naRSS, naLog, naCommon, naAddress, naAppointment, naMeeting, naNote, naInternet);


TMAPINamedPropOrd = (nidKeywords, nidCategories, etc...);


TOutlookNamedExPropList = array of TOutlookNamedPropEx;

TMAPINamedPropOrdList = array of TMAPINamedPropOrd;


TOutlookNamedPropEx = record
 ID: TMAPINamedPropOrd;
 Area: TMAPINamedArea;
 PID_NAME: PWideChar;
 PROP_TYPE: WORD;
 MAPINAMEID: TMAPINAMEID;
end;


TBusinessCardDisplayDefinition = packed record
   MajorVersion: Byte;
   MinorVersion: Byte;
   TemplateID: Byte;
   CountOfFields: Byte;
   FieldInfoSize: Byte;
   ExtraInfoSize: Byte;
   ImageAlignment: Byte;
   ImageSource: Byte;
   BackgroundColor: Integer;
   ImageArea: Byte;
   Reserved: Integer;
   FieldInfo: array [0 .. 0] of TBusinessCardFieldInfo;
   ExtraInfo: array [0 .. 0] of WideChar;
end;

 PBusinessCardDisplayDefinition = ^TBusinessCardDisplayDefinition;

description
  Specifies user-customization details for displaying a contact as a business card. See PidLidBusinessCardDisplayDefinition

fields
   MajorVersion - An 8-bit value that specifies the major version number. This field MUST be set to $03 or greater
   MinorVersion - An 8-bit value that specifies the minor version number. This field SHOULD be set to $00
   TemplateID - An 8-bit value that specifies the layout of the business card
   CountOfFields - An integer that specifies the number of FieldInfo structures
   FieldInfoSize - An integer that specifies the size, in bytes, of each FieldInfo structure that is contained in the FieldInfoN field. This field MUST be set to 16
   ExtraInfoSize - An integer that specifies the size, in bytes, of the ExtraInfo field
   ImageAlignment - An 8-bit value that specifies the alignment of the image within the image area
   ImageSource - An 8-bit value that specifies the source of the image that is used for the business card
   BackgroundColor - A 32-bit value that specifies the background color of the business card
   ImageArea - An integer that specifies the percent of space that the image will occupy on the business card. The value of this field SHOULD be between 4 and 50
   Reserved - MUST be ignored
   FieldInfo - An array of zero or more TBusinessCardFieldInfo structures, each of which contains details about the text field of a business card
   ExtraInfo - An array of null-terminated Unicode strings, each of which specifies a business card label that has been provided by the user. Each business card label SHOULD be limited to 16 Unicode characters, including the terminating null character


TBusinessCardFieldInfo = packed record
   TextPropertyID: WORD;
   TextFormat: Byte;
   LabelFormat: Byte;
   FontSize: Byte;
   Reserved: Byte;
   LabelOffset: Smallint;
   ValueFontColor: Integer;
   LabelFontColor: Integer;
end;

description
 
Contains details about a text field on the business card

fields
 
 TextPropertyID - A 16-bit value that specifies the property to be used for the text field. The value of the TextPropertyID field MUST be either $0000, representing an empty text field, or the property ID.
   TextFormat - An 8-bit value that specifies the alignment and formatting for the text field.
   LabelFormat - An 8-bit value that specifies the alignment of a user-provided label that is associated with the text field
   FontSize - An integer that specifies the font size, in points, of the text field. The font size MUST be between 3 and 32. The font size MUST zero if the text field is displayed as an empty line.
   Reserved - MUST be ignored
   LabelOffset - An integer that specifies the byte offset into the ExtraInfo field of the TBusinessCardDisplayDefinition
   ValueFontColor - An integer that specifies the color of the text field
   LabelFontColor - An integer that specifies the color of the label


PCONTAB_ENTRYID = ^TCONTAB_ENTRYID;

TCONTAB_ENTRYID = packed record
  abFlags: array [0 .. 3] of Byte;
  uidResource: array [0 .. 15] of Byte; // MUIDCFAB -> EXTRAS.INC // FE42AA0A18C71A10E8850B651C240000
  version: ULONG;
  type_: ULONG; // type (4 = contact, 5 = distlist)
  SelectedAddress: ULONG; // selected address from the IPM.Contact message (email1 = 0, email2, email3, fax, etc)
  // EntryID of contact in store.
  cbeid: ULONG;
  eid: array [0 .. 0] of Byte;
end;

description
  Describe the decoded Address Book EntryID for Contact item


PONE_OFF_ENTRYID = ^TONE_OFF_ENTRYID;

TONE_OFF_ENTRYID = packed record
 abFlags: array [0 .. 3] of Byte;
 uidResource: array [0 .. 15] of Byte; // MAPI_ONE_OFF_UID
 wVersion: WORD;
 wFlags: WORD;
 Path: array [0 .. 0] of Byte;
end;

description
  Describe the One-Off EntryID


PWRAPPED_DL_ENTRYID = ^TWRAPPED_DL_ENTRYID;

TWRAPPED_DL_ENTRYID = packed record
  abFlags: array [0 .. 3] of Byte;  
  uidResource: array [0 .. 15] of Byte; // MUID_PDL: array [0 .. 15] of BYTE = ($C0, $91, $AD, $D3, $51, $9D, $CF, $11, $A4, $A9, $00, $AA, $00, $47, $FA, $A4) 
  WarappedType: Byte; //  TPDLMemberAddrType and TPDLMemberType
  eid: array [0 .. 0] of Byte;  
end;

description
  Describe a wrapped entry identifier of a member of a personal distribution list


TNetMeetingType = (oNetMeeting, oNetShow, oChat);

description
 
Specifies the type of the meeting (PidLidConferencingType)

Name Description
oNetMeeting Windows Netmeeting
oNetShow Windows Media Services
oChat Exchange Conferencing

TRecurrenceFrequency = (RecFreqTypeNone, RecFreqTypeDaily, RecFreqTypeWeekly, RecFreqTypeMonthly, RecFreqTypeYearly);

description
 
Specifies the recurrence type of the recurring series (PidLidRecurrenceType)

Name Description
RecFreqTypeNone A single instance appointment
RecFreqTypeDaily A daily recurrence pattern
RecFreqTypeWeekly A weekly recurrence pattern
RecFreqTypeMonthly A monthly recurrence pattern
RecFreqTypeYearly A yearly recurrence pattern

TRecurrenceTermType = (oRecursTermDate, oRecursTermNumber, oRecursTermNever);

description
  Specifies the ending type for the recurrence

Name Description
oRecursTermDate End after date
oRecursTermNumber End after N occurrences
oRecursTermNever Never end

TRecurrenceDayOfWeek = (oSunday, oMonday, oTuesday, oWednesday, oThursday, oFriday, oSaturday);

description
 
Specifies the day on which the calendar week begins (RecurrencePattern)


TRecurrenceInstance = (orfNone, orfFirst, orfSecond, orfThird, orfFourth, orfLast);

description
 
Specifies the occurrence of the recurrence's days in each month in which the recurrence falls

Name Description
orfNone None
orfFirst The recurrence falls on the first occurrence of the days specified in every month
orfSecond The recurrence falls on the second occurrence of the days specified in every month
orfThird The recurrence falls on the third occurrence of the days specified in every month
orfFourth The recurrence falls on the fourth occurrence of the days specified in every month
orfLast The recurrence falls on the last occurrence of the days specified in every month

const  //  recurrence's days
  cSunday = $00000001;
  cMonday = $00000002;
  cTuesday = $00000004;
  cWednesday = $00000008;
  cThursday = $00000010;
  cFriday = $00000020;
  cSaturday = $00000040;
  cWeekday = cMonday or cTuesday or cWednesday or cThursday or cFriday;
  cWeekendDay = cSunday or cSaturday;
  cDay = cWeekday or cWeekendDay;


 TAppointmentLabelColor = (oalcNone, oalcImportant, oalcBusiness, oalcPersonal, oalcVacation, oalcMustAttend, oalcTravelRequired, oalcNeedsPreparation, oalcBirthday, oalcAnniversary, oalcPhoneCall);

description
 
Specifies the color to use when displaying the calendar. (PidLidAppointmentColor)

Name Description (color)
oalcNone None
oalcImportant Red
oalcBusiness Blue
oalcPersonal Green
oalcVacation Grey
oalcMustAttend Orange
oalcTravelRequired Cyan
oalcNeedsPreparation Olive
oalcBirthday Purple
oalcAnniversary Teal
oalcPhoneCall Yellow

TAppointmentlColor = (acNone = $00000000, acRed = $00000001, acBlue = $00000002, acGreen = $00000003, acGrey = $00000004, acOrange = $00000005, acCyan = $00000006, acOlive = $00000007, acPurple = $00000008, acTeal = $00000009, acYellow = $0000000A);


TOverrideFlags = (aroSUBJECT, aroMEETINGTYPE, aroREMINDERDELTA, aroREMINDER, aroLOCATION, aroBUSYSTATUS, aroATTACHMENT, aroSUBTYPE, aroAPPTCOLOR, aroEXCEPTIONALBODY);
TOverrideFlagsSet = set of TOverrideFlags;

description
 
Specifies what data in the ExceptionInfo structure has a value different from the recurring series

Name Description
aroSUBJECT Indicates that the Subject, SubjectLength, and SubjectLength2 fields are present
aroMEETINGTYPE Indicates that the MeetingType field is present
aroREMINDERDELTA Indicates that the ReminderDelta field is present
aroREMINDER Indicates that the ReminderSet field is present
aroLOCATION Indicates that the Location, LocationLength, and LocationLength2 fields are present
aroBUSYSTATUS Indicates that the BusyStatus field is present
aroATTACHMENT Indicates that the attachment field is present
aroSUBTYPE Indicates that the SubType field is present
aroAPPTCOLOR Reserved and MUST NOT be set
aroEXCEPTIONALBODY Indicates that the Exception Embedded Message object has the PidTagRtfCompressed property set on it

TRecurrenceExceptionInfo = record
  StartDateTime: TDateTime;
  EndDateTime: TDateTime;
  OriginalStartDate: TDateTime;
  OverrideFlags: TOverrideFlagsSet;
  Subject: WideString;
  MeetingType: DWORD;
  ReminderDelta: DWORD;
  ReminderSet: Boolean;
  Location: WideString;
  BusyStatus: TBusyStatus;
  Attachment: Boolean;
  AllDayEvent: Boolean;
  AppointmentColor: DWORD;
  ChangeHighlight: DWORD;
end;

TRecurrenceExceptionInfoArray = array of TRecurrenceExceptionInfo;

description
  Specifies the Recurrence Exception Info structure

fields

   StartDateTime -  The start time of the exception
  EndDateTime - The end time of the exception
  OriginalStartDate - The original starting time of the exception
  OverrideFlags -  Specifies what data in the ExceptionInfo structure has a value different from the recurring series
  Subject - String that is the value of the PidTagNormalizedSubject property in the Exception Embedded Message object. Only when the aroSUBJECT flag is set in the OverrideFlags field.
  MeetingType - The value of the PidLidAppointmentStateFlags property in the Exception Embedded Message object. This field is valid only when the aroMEETINGTYPE flag is set in the OverrideFlags field
  ReminderDelta - The value for the PidLidReminderDelta property in the Exception Embedded Message object. This field is valid only when the aroREMINDERDELTA flag is set in the OverrideFlags field.
  ReminderSet - The value for the PidLidReminderSet property in the Exception Embedded Message object. This field is valid only when the aroREMINDER flag is set in the OverrideFlags field
  Location - String that is the value of the PidLidLocation property in the Exception Embedded Message object. This field is valid only when the aroLOCATION flag is set in the OverrideFlags field.
  BusyStatus - The value for the PidLidBusyStatus property in the Exception Embedded Message object. This field is valid only when the aroBUSYSTATUS flag is set in the OverrideFlags field.
  Attachment - The value of this field specifies whether the Exception Embedded Message object contains attachments. This field is valid only when the aroATTACHMENTS flag is set in the OverrideFlags field
  AllDayEvent - The value for the PidLidAppointmentSubType property in the Exception Embedded Message object. This field is valid only when the aroSUBTYPE flag is set in the OverrideFlags field
  AppointmentColor - This field is valid only when the aroAPPTCOLOR flag is set in the OverrideFlags field.
  ChangeHighlight - The value of the PidLidChangeHighlight property in the Exception Embedded Message object. Specifies a bit field that indicates how the Meeting object has changed.


TTaskStatus = (olTaskNotStarted, olTaskInProgress, olTaskComplete, olTaskWaiting, olTaskDeferred);

description
  Specifies the status of the user's progress on the task. (PidLidTaskStatus)

Name Description
olTaskNotStarted The user has not started work on the task. If this value is set, PidLidPercentComplete must be 0.0.
olTaskInProgress The user’s work on this task is in progress. If this value is set, PidLidPercentComplete must be greater than 0.0 and less than 1.0.
olTaskComplete The user’s work on this task is complete. If this value is set, PidLidPercentComplete must be 1.0, PidLidTaskDateCompleted must be the current date, and PidLidTaskComplete must be TRUE.
olTaskWaiting The user is waiting on somebody else.
olTaskDeferred The user has deferred work on the task.

TTaskState = (oltsUnknown, oltsNotAssigned, oltsAssignee, oltsAssigner, oltsRejected);

description
  Indicates the current assignment state of the task. (PidLidTaskState)

Name Description
oltsUnknown This Task object was created to correspond to a Task object that was embedded in a task rejection but could not be found locally.
oltsNotAssigned The task object is not assigned.
oltsAssignee The Task object is the task assignee's copy of an assigned Task object.
oltsAssigner The Task object is the task assigner's copy of an assigned Task object.
oltsRejected The Task object is the task assigner's copy of a rejected Task object.

TSpecialFolders = record
  EntryID: TBytes;   // PR_ENTRYID (Folder Unique ID)
  FolderType: TMAPIFldType;
end;

PSpecialFolders = ^TSpecialFolders;
TSpecialFoldersList = array of TSpecialFolders;

description
  Specifies the EntryID and folder type for "special folders" as inbox, outbox, contacts, etc


TMapiNameIDList = array of TMAPINAMEID;
TDateTimeArray = array of TDateTime;
TBytesArray = array of TBytes;


FollowUpStatus = (flwupNone, flwupComplete, flwupMarked);  // PR_FLAG_STATUS
TFollowUpStatus = FollowUpStatus;


// Values for PR_FOLLOWUP_ICON
OlFlagIcon = (olNoFlagIcon, olPurpleFlagIcon, olOrangeFlagIcon, olGreenFlagIcon, olYellowFlagIcon, olBlueFlagIcon, olRedFlagIcon);
TOlFlagIcon = OlFlagIcon;

values:

olNoFlagIcon - No flag is associated with the item.
olPurpleFlagIcon - Purple is associated with the flagged item.
olOrangeFlagIcon - Orange is associated with the flagged item.
olGreenFlagIcon - Green is associated with the flagged item.
olYellowFlagIcon - Yellow is associated with the flagged item.
olBlueFlagIcon - Blue is associated with the flagged item.
olRedFlagIcon - Red is associated with the flagged item.



functions:
 function MessageClassToMessageType(Value: string): TMsgType;
  description:  Based on the Message class string (PR_MESSAGE_CLASS) such as "IPM.Note", returns a message type, such as oMessage

 function GetMessageType(const MAPIMsg: IMessage): TMsgType;
  description: Returns a message type (TMsgType), such as oStickyNote 

 function MessageTypeToMessageClass(Value: TMsgType): string;
  description: Returns a message class as string, such as  "IPM.Activity" for TMsgType, such as oJournal

 function GetMAPIPropType(const PropType: ULONG): WideString;
  description: Returns a property type as string, such as 'PT_APPTIME' for PROP_TYPE, such as PT_APPTIME

 function StickyNoteColorToDelphi(const NoteColor: TStickyNoteColor): TColor;
  description: Returns a Delphi TColor, such as $E6D8AD (LightBlue)  from TStickyNoteColor, such as  osncBlue

 function MAPIPhoneIDToTContactPhoneID(const PropID: ULONG): TContactTelephones;
  description: Returns a TContactTelephones, such as olcPrimary  from PropID, such as  PR_PRIMARY_TELEPHONE_NUMBER

 function FolderDefMsgType(const FldType: TMAPIFldType): TMsgType;
  description: Returns a default message type (TMsgType), such as  oAppointment (Appointment), for a folder type (TMAPIFldType), such as oFolderCalendar (Calendar folder)


type
  TMAPIBase = class(TObject)
  protected
    hr: HRESULT;
    FOwner: TMAPIBase;
    FMAPISession: Pointer;
    FMAPIObject: IUnknown;
    FObjectType: ULONG;
    function GetOwner: TMAPIBase;
    function GetObjectType: TMAPIObjType; virtual;
    procedure SetOwner(const oOwner: TMAPIBase);
    function GetMAPISession: IMAPISession;
    procedure SetMAPISession(const oMAPISession: IMAPISession);
    procedure RaiseMAPIError(const ErrCode: HRESULT = 0);
  public
    constructor Create;
    destructor Destroy; override;
    property MAPIObjType: TMAPIObjType Read GetObjectType;
    property MAPISession: IMAPISession read GetMAPISession write SetMAPISession;
  end;

description:
  TMAPIBase is the based object for all Extended MAPI objects.

   property MAPIObjType: TMAPIObjType - Identifies type of MAPI object, such as omFOLDER, omMESSAGE, etc.
   property MAPISession: IMAPISession - gives access to interface used to manage objects associated with a MAPI session.  
 


TTimeZoneInformationEx = _TIME_ZONE_INFORMATION_EX;

_TIME_ZONE_INFORMATION_EX = record
   Bias: Longint;
   StandardName: array [0 .. 31] of WCHAR;
   StandardDate: TSystemTime;
   StandardBias: Longint;
   DaylightName: array [0 .. 31] of WCHAR;
   DaylightDate: TSystemTime;
   DaylightBias: Longint;
   TimeZoneKeyName: array [0 .. 127] of WCHAR;
end;

description
  Specifies settings for a time zone and TimeZone name.

    Bias: Longint -  The current bias for local time translation on this computer, in minutes.
   StandardName: array [0 .. 31] of WCHAR - A description for standard time. For example, "EST" could indicate Eastern Standard Time.
   StandardDate: TSystemTime - A SYSTEMTIME that contains a date and local time when the transition from daylight saving time to standard time occurs on this operating system.
   StandardBias: Longint - The bias value to be used during local time translations that occur during standard time.
   DaylightName: array [0 .. 31] of WCHAR - A description for daylight saving time (DST). For example, "PDT" could indicate Pacific Daylight Time.
   DaylightDate: TSystemTime - A SYSTEMTIME that contains a date and local time when the transition from standard time to daylight saving time occurs on this operating system.
   DaylightBias: Longint - The bias value to be used during local time translations that occur during daylight saving time.
   TimeZoneKeyName: array [0 .. 127] of WCHAR - The name of the time zone registry key on the local computer.

 


 


Copyright © 2021 IMIBO
Privacy Statement