MAPI.Kit for Delphi – Examples
MAPI.Kit Example #35
Meetings: attendees, requests and responses
Needs Delphi 10.4 Sydney or later; demonstration project.
The meetings of a store and the meeting objects of [MS-OXOCAL]. For each meeting: its attendees with their responses, the meeting properties as stored and a printable list of the attendees. As the organizer: a new meeting, attendees added and removed, a response recorded by hand, the request, an update, the cancellation. As an attendee: Accept, Tentative, Decline on a received request, and a received response or cancellation processed into the meeting.
In this example
TMAPIAppointment:MakeMeeting,Attendees,AttendeeSummary,AddAttendee,SetAttendeeResponseBuildMeetingRequest/SendMeetingRequest, the meeting update,CancelMeetingTMAPIMeetingMessage:Respond,BuildResponse,ProcessRequest,ProcessResponse,ProcessCancellation
Works with
A copy of the examples’ test store with sample meetings (default, writable): a .pst file has no transport, so what would be sent is put into Drafts. A profile (Exchange) sends for real – only with --save; a .pst file or a profile is only read otherwise.
Run: MeetingAttendees.exe (a copy of the test store), MeetingAttendees.exe "C:\Data\Archive.pst" (read-only), MeetingAttendees.exe --profile[=Name] [--save].
Download MAPI.Kit Example #35, compiled and signed (Win32 and Win64)
Download Source code of the example (Delphi 10.4 Sydney – Delphi 13 Florence)
MAPI.Kit library: free DCU packages
Level: GUI application, VCL application
Delphi: 10.4 Sydney and later
Class reference: “Outlook Items”
What it shows
A meeting with its attendees and their responses:
How it works
1. A meeting you organize. MakeMeeting turns an appointment into a meeting with its organizer; AddAttendee returns the row of the attendee, used later for the response. In a .pst file the request is built and taken as sent.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Meeting := Cal.CreateMessage('IPM.Appointment') as TMAPIAppointment; try Meeting.Subject := 'Project kick-off'; Meeting.Location := 'Room 4'; Meeting.StartWhole := Monday + EncodeTime(10, 0, 0, 0); Meeting.EndWhole := Monday + EncodeTime(11, 0, 0, 0); Meeting.BusyStatus := olBusy; Meeting.ResponseRequested := True; Meeting.MakeMeeting(LocalOrganizerName, '', LocalOrganizerAddress); Rows := [..., Meeting.AddAttendee('Carla Gomez', 'carla@example.com', matOptional), Meeting.AddAttendee('Room 4', 'room4@example.com', matResource)]; Meeting.Save; Req := Meeting.BuildMeetingRequest(Drafts); // a .pst has no transport: built ... try Meeting.MeetingObjectSent(Req); // ... and taken as sent Drafts.DeleteMessages([Req.EntryID], True); finally Req.Free; end; Meeting.SetAttendeeResponse(Rows[0], olResponseAccepted, Now - 2); Meeting.Save; finally Meeting.Free; end;
2. A received meeting message. A request is answered (the meeting created or updated in the calendar); a response or a cancellation is processed into the meeting.
1 2 3 4 5 6 7 8
Req.Respond(Response, Cal, Drafts, AStore.IPMFolder[oFolderDeletedItems], Exchange); ... Meeting := Obj.ProcessRequest(Cal); // created or updated; the caller frees it ... if not Obj.ProcessResponse(Cal) then ... if not Obj.ProcessCancellation(Cal) then ...
Every MAPI call runs on one worker thread (ExampleWorker from the examples’ Common folder): the window posts a job that gets the session and the store, and the result comes back on the main thread. The window never waits for MAPI.
Units
MAPIKit (TMAPIAppointment, TMAPIMeetingMessage) and ExampleWorker, ExampleUtils and TestStore from the examples’ Common folder.

