Oxmapi: Difference between revisions

From Open-Xchange
(New page: == Introduction == This document defines OXMAPI32 API. It provides access to a Open-Xchange 6 Server by using the Open-Xchange HTTP API. The OXMAPI32 API can be used for Windows applicati...)
 
No edit summary
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
This document defines
OXMAPI32 API. It provides access to a Open-Xchange 6 Server by using
the Open-Xchange HTTP API. The OXMAPI32 API can be used for Windows
applications. The OXMAPI32 API  architecture bases on the Microsoft
MAPI so the convention of constants and objects are similar. <br/>
This document describes the functionality of each object in the respective module, which are ordinated corresponding the object model. Each module provides code
examples how to use the respective object written in Delphi.


This document defines OXMAPI32 API. It provides access to a Open-Xchange 6 Server by using the Open-Xchange HTTP API. The OXMAPI32 API can be used for Windows applications. The OXMAPI32 API  architecture bases on the Microsoft MAPI so the convention of constants and objects are similar. <br/>
== OXMAPI Object Model ==


This document describes the functionality of each object in the respective module, which are ordinated corresponding the object model. Each module provides code examples how to use the respective object written in Delphi.
<IMG SRC="oxmapi32_html_m7b3028d.png" NAME="Grafik1" ALIGN=LEFT WIDTH=642 HEIGHT=238 BORDER=0>


=== OXMAPI Object Model ===
== Constants ==
This topic provides a list of all constant in the object model. OlDefaultFolders relate to
the default folder subordinated to the private folder of the current user.
 
{|  WIDTH=287 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=134><COL WIDTH=135>  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=135 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Value</B></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>OlAppointmentItem
</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>1</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>olContactItem</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>2</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>OlDistributionListItem</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>7</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>olTaskItem
  </FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>3</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 1.
OlItemType</I></FONT></P><P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"></P>
<br/>
{|  WIDTH=287 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=134><COL WIDTH=135>  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=135 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Value</B></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>olFolderCalendar</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>9</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>olFolderContacts</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>10</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>olFolderlTasks</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>13</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 2.
OlDefaultFolders</I></FONT></P>
<br/>
<P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"><BR></P>
{|  WIDTH=287 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=134><COL WIDTH=135>  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=135 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>ID</B></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>private</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>1</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>public</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>2</FONT></P>
|-  VALIGN=TOP
|  WIDTH=134 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>shared</FONT></P>
|  WIDTH=135 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>3</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 3.
top level folder IDs</I></FONT></P>
 
== App Object ==
Represents the root for any data source object. The App Object has several purposes:
<UL><LI><P CLASS="western" STYLE="font-style: normal">As the root
object, it allows access to other objects in the oxmapi hierarchy.</P><LI><P CLASS="western" STYLE="font-style: normal">It allows access
to a new item created by using CreateItem.</P><LI><P CLASS="western" STYLE="font-style: normal"> It provides
methods accessing certain special default folders directly.</P><LI><P CLASS="western" STYLE="font-style: normal">It provides the
Entry Point for establishing the connection</P></UL>


== Constants ==
<P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Application</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to  the  App Object itself.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Name of  the Application.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current Session Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Version</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Number of the current Version</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 4.
App Properties</I></FONT></P><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><BR><BR></P><br/>
 
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=57*><COL WIDTH=124*>  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=22% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=48% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>CreateItem</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=22% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Item:
OlDefaultItems</FONT></P>
|  WIDTH=48% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Creates
a new item and returns it. The CreateItem method can only create
items listet in  Table 1</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>CreateRecipient</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IRecipient</FONT></P>
|  WIDTH=22% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Value:
Variant</FONT></P>
|  WIDTH=48% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Creates
and returns a </FONT>Recipient<FONT SIZE=2> object.  </FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetDefaultFolder</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
|  WIDTH=22% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name:
OlDefaultFolders</FONT></P>
|  WIDTH=48% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
a MAPIFolder object that represents the default folder of the
requested type for the current profile. Default folders are
described in  Table 2</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetFolderFromID</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
|  WIDTH=22% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ID:
Variant</FONT></P>
|  WIDTH=48% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
a MAPIFolder object identified by the specified entry ID (if
valid).</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Quit</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=22% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=48% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>The
associated session is closed completely; the user is logged out of
the messaging system and any changes to items not already saved
are discarded. </FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 5.
App Methods</I></FONT></P><P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"><BR></P>
 
=== Using the App Object ===


This topic provides a list of all constant in the object model. OlDefaultFolders relate to the default folder subordinated to the private folder of the current user.<br/>
Use the CoClass.Create method to instantiate a new Application.  


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
{| WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
!|Name
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
!|Value
example:</U></P>
|-
|-
|OlAppointmentItem||1
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
|-
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application
|olContactItem||2
:= CoApp.Create;</FONT></FONT></P>
|-
|OlDistributionListItem||7
|-
|olTaskItem||3
|}
|}
Examples showing how to use the functions of the App Object are described in
the corresponding module. An example for a folder request is presented in the module of the MAPIFolder object. An example how to create items is presented in the module of the Item Interface .


<center>OlItemType</center><br/>
== Session Object ==


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
Represents a connection to the OX-Server. The object itself provides methods for logging in and out. The Logon Method requires a valid IP-Address to the server.
!|Name
 
!|Value
{| WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|-
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|olFolderCalendar||9
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|-
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|olFolderContacts||10
|-  VALIGN=TOP
|-
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Parent</FONT></P>
|olFolderlTasks||13
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the current App Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the Session Object itself.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Connected</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>WordBool</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Flag which indicates whether Session  is connected to the server
or not.</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 6.
Session Properties</I></FONT></P><br/>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=30*><COL WIDTH=27*><COL WIDTH=68*><COL WIDTH=132*>  VALIGN=TOP
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=11% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=26% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=51% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>SetIP</FONT></P>
|  WIDTH=11% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Value:
Variant</FONT></P>
|  WIDTH=51% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|-  VALIGN=TOP
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Logon</FONT></P>
|  WIDTH=11% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Username,
Password: Variant</FONT></P>
|  WIDTH=51% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Logs
the user on to MAPI, obtaining a MAPI session.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Logoff</FONT></P>
|  WIDTH=11% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=51% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Logs
the user off from the current MAPI session. </FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 7.
Session Methods</I></FONT></P>
 
=== Using the Session Object ===
To establish a connection to the server, use the following example:
 
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="text-decoration: none"> Connection</SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application.Session.SetIP('192.168.0.1');</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application.Session.Logon;</FONT></FONT></P>
|}<P CLASS="western" STYLE="font-style: normal"><BR><BR></P>
 
== MAPIFolder Object ==
Represents a  folder. A MAPIFolder object can contain other MAPIFolder objects, as well as items. Therefore the MAPIFolder Object contains the Folders Object and the Items Object to obtain subordinated elements.
You can navigate nested folders by using a combination of Folders.item(index), which returns
the subfolder with the position of the index.
 
The MAPIFolder Object is typed; for example, the Calendar folder will only contain AppointmentItem  objects and the Contacts folder will only contain ContactItem  and DistListItem  objects.
 
<P CLASS="western" STYLE="font-style: normal"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Application</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current App Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EntryID</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Folder ID of  corresponding folder on the server.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Parent</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the Parentfolder. If the current folder is a root
folder (private folder, public folder, shared folder or infostore)
this property returns null.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current Session Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Folders</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IFolders</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Folders Object representing all subfolders contained in this
folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Items</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItems</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Items Object representing all items contained in this folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
Name of the folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Category</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Category of the folder.</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 8.
MAPIFolder Properties</I></FONT></P><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=91*><COL WIDTH=89*>  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=36% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=35% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Delete</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Deletes
the folder</FONT></P>
|-  VALIGN=TOP
| WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MoveTo</FONT></P>
| WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
| WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>DestinationFolder:
MAPIFolder</FONT></P>
| WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Moves
the folder to the specified destination folder</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 9.
MAPIFolder Methods</I></FONT></P>
 
=== Using the MAPIFolder Object ===
This example uses the GetDefaultFolder method to obtain the default Calendar folder for a user who is currently logged in. Use OlDefaultFolders described in Table 2 to obtain the default folder.
 
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 <COL WIDTH=256*>
| WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
GetDefaultFolder</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Folder:
MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Folder
:= App.GetDefaultFolder(olFolderCalendar);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western" STYLE="font-style: normal; text-decoration: none"><BR><BR></P>
The default folders constants provides access to the private default folders. To obtain a top level folder, use the GetFolderFromID
method. The following example shows how to obtain the private folder.
{| WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
| WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
GetFolderFromID</SPAN></SPAN></P>
|-
| WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Folder:
MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Folder
:= App.GetFolderFromID('1');</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}
|}


<center>OlDefaultFolders</center><br/>
To add a new folder, use the add method of the Folders property. An example how to add a folder is presented in the Folders Object module. To add a new item, use the add method of the Items property. An example
how to add a item is presented in the Items Object module.
 
== Folders Object ==
Represents all folders in a  MAPIFolder object. The Folders Object provides a collection of methods to obtain subordinated folders.<BR><BR>
 
{|  WIDTH=643 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=92><COL WIDTH=151><COL WIDTH=374>  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=151 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=374 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Application</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current App Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Parent</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  MAPIFolder Object. </FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current Session Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Count</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Long</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:Number
of subfolders contained in the Parent MAPIFolder</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 10.
Folders Properties</I></FONT></P><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=93*><COL WIDTH=87*>  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=36% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=34% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Add</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name:
Variant, Type_:  OlDefaultFolders</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Creates
a new folder in the Parent MAPIFolder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Find</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Filter:
Variant</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Locate
and returns a direct subfolder</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetFirst</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the first subfolder</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetLast</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the last subfolder</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetNext</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the next subfolder. It returns null if no next subfolder exists,
if already positioned at the last folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetPrevious</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the previous subfolder. It returns null if no previous subfolder
exists, if already positioned at the first folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Item</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MAPIFolder</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
a subfolder positioned at the index number.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Remove</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Deletes
a subfolder positioned at the index number</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 11.
Folders Methods</I></FONT></P><P STYLE="margin-top: 0.42cm; font-style: normal; page-break-after: avoid"><BR><BR></P>
 
=== Using the Folders Object ===
This example uses the item method to visit subordinated folders and returns the folder &ldquo;old contacts&rdquo;.
 
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
visit subfolders</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>i:
integer;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder,
Folder: MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder
:= App.GetDefaultFolder(olFolderCalendar);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>for
i := 0 to Contactfolder.Count-1 </FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Folder
:= Contactfolder.folders.item(i);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>if
(Folder.Name = 'old contacts') then</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Result
:= Folder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end</FONT></FONT></P><P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>else</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Result
:= nil;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|}<P CLASS="western" STYLE="font-style: normal; text-decoration: none"><BR><BR></P>
To add a new folder, use the add method. The Add method has an optional argument that can be used to specify the type of items that can be stored in that folder. By default, folders created inside another folder inherit the type of the parent folder.
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
add a new folder</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>newfolder,
Contactfolder: MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder
:= App.GetDefaultFolder(olFolderCalendar);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>newfolder
:= Contactfolder.Folders.add('new
contactfolder',olFolderContacts);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western" STYLE="margin-bottom: 0cm"><BR></P>
 
== Items Object ==
Represents all Items in a  MAPIFolder object. The Items Object provides a collection of methods to obtain subordinated folders.
 
{|  WIDTH=643 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=92><COL WIDTH=151><COL WIDTH=374>  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=151 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=374 | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Application</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current App Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Parent</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  MAPIFolder Object. </FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current Session Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=92 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Count</FONT></P>
|  WIDTH=151 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Long</FONT></P>
|  WIDTH=374 | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:Number
of Items contained in the Parent MAPIFolder</FONT></P>
|}<P CLASS="western" ALIGN=CENTER><I>Table 12. Items Properties</I></P><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=93*><COL WIDTH=87*>  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=36% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=34% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Add</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name:
Variant, Type_:  OlDefaultItems</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Creates
a temporary Item in the Parent MAPIFolder. To create a persistent
item, invoke  the save method of the item.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Find</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Filter:
Variant</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Locate
and returns a Item matching the Filter.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetFirst</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the first Item.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetLast</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the last Item.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetNext</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the next Item. It returns null if no next Item exists, if already
positioned at the last Item.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetPrevious</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
the previous Item. It returns null if no previous Item exists, if
already positioned at the first Item.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Item</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IItem</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
a Item positioned at the index number.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Remove</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
|  WIDTH=34% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Deletes
a Item positioned at the index number.</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 13.
Items Methods</I></FONT></P><P STYLE="margin-top: 0.42cm; font-style: normal; page-break-after: avoid"><BR><BR></P>
 
=== Using the Items Object ===
This example uses the item method to obtain items contained in the parent folder.
</P>
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
obtaining folder items</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>i:
integer;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder:
MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Currentitem:
Item;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder
:= App.GetDefaultFolder(olFolderCalendar);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>for
i := 0 to Contactfolder.Count-1 </FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Currentitem
:= Contactfolder.items.item(i);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>if
(Currentitem.Subject = 'John Smith') then</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Result
:= Current;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>else</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Result
:= nil;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western" STYLE="font-style: normal; text-decoration: none"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>To
add a new item, use the add method. The Add method has an optional
argument that can be used to specify the type of the item. By
default, items created inside the parent folder inherit the type by
means of the parent folder. In the case a contact folder adds a new
item, the result is an Item interface referring to a ContactItem
Object.</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal; text-decoration: none"><FONT FACE="Times New Roman, serif"><FONT SIZE=3>The
Add method creates a temporary and specific item. To make it
persistent, it needs to be saved by invoking the Save method.</FONT></FONT></P>
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
add a new item</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App; </FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder:
MAPIFolder;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem:
Item;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Contactfolder
:= Application.GetDefaultFolder(olFolderContacts);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem
:= Contactfolder.Items.add(olContactItem);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem.Subject
:= 'John Smith';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem.Save;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western" STYLE="margin-bottom: 0cm; font-style: normal"><BR></P>
 
== Item Interface ==
The Item interface is a common Interface to handle basic functions of a specific item object and to abstract the specific items. 


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
<P CLASS="western" STYLE="font-style: normal">The Item interface is
!|Name
the root for all specific item interfaces; for example, a ContactItem
!|ID
interface inherits the properties and methods of the Item interface.</P><P CLASS="western" STYLE="font-style: normal"><SPAN LANG="en-US">To
|-
identify an item, use the Message Class property. Message Class
|private||1
Values are described in Table 14.</SPAN></P><P CLASS="western" STYLE="font-style: normal"><BR><BR></P><DL><DL><DL><DL><DL><DL><DL><DD>
|-
{| WIDTH=119 BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=109>
|public||2
|  WIDTH=109 VALIGN=TOP | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>MessageClass</B></P>
|-
|-
|shared||3
|  WIDTH=109 VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IPM.Appointment</FONT></P>
|-
|  WIDTH=109 VALIGN=TOP | <P CLASS="western" ALIGN=LEFT STYLE="font-style: normal"><FONT SIZE=2>IPM.Contact</FONT></P>
|-
|  WIDTH=109 VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IPM.DistList</FONT></P>
|-
|  WIDTH=109 VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IPM.Task
</FONT></P>
|}</DL></DL></DL></DL></DL></DL></DL><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 14.
MessageClasses</I></FONT></P><P ALIGN=LEFT STYLE="margin-top: 0.21cm"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Application</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IApp</FONT></P>
| WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current App Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EntryID</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
| WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
ID of corresponding  item on the server.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Parent</FONT></P>
| WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IMAPIFolder</FONT></P>
| WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the Parentfolder. If the current folder is a root
folder (private folder, public folder, shared folder or infostore)
this property returns null.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the  current Session Object.</FONT></P>
|-  VALIGN=TOP
| WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>CreationTime</FONT></P>
| WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Date</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Body</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Items Object representing all items contained in this folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Subject</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
Name of the folder.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Saved</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Wordbool</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
indicates whether the save method has been successfull.or not</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MessasgeClass</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 15.
Item Properties</I></FONT></P><P ALIGN=CENTER STYLE="margin-top: 0.21cm"><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=91*><COL WIDTH=89*>  VALIGN=TOP
| WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
| WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
|  WIDTH=36% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
|  WIDTH=35% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Delete</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
|  WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Deletes
the item</FONT></P>
|-  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Move</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
|  WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>DestinationFolder:
MAPIFolder</FONT></P>
|  WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Moves
the item to the specified destination folder</FONT></P>
|-  VALIGN=TOP
| WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Save</FONT></P>
| WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
| WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><BR></P>
| WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Stores
a new  item on the server or updates the existing one. If required
properties are not set, the Save method will fail.</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 16.
Item Methods</I></FONT></P>
 
=== Using the Item Interface ===
The following example shows how to create a new Appointment in the default calendar folder. To use the new item as Appointment, the Item interface has to be casted to an AppointmentItem.
<P CLASS="western" STYLE="font-style: normal; text-decoration: none">Remark:
Like the Add method in the Items Object, CreateItem also creates a
temporary item. To make it persistent, the Save method has to be
invoked.</P>
 
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
CreateItem</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem:
Item;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment:
AppointmentItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newitem
:= Application.CreateIem(olAppointmentItem);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment
:= Newitem as AppointmentItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}
|}


<center>top level folder IDs</center><br/>
== AppointmentItem Object ==
Represents an appointment in the Calendar folder. An AppointmentItem posses properties described in Table 15 and Table 17, methods described in Table 16. Valid Values in Subject, StartDate and EndDate properties
are required for saving.


== App Object ==
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
Represents the root for any data source object. The App Object has several purposes:
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
*As the root object, it allows access to other objects in the oxmapi hierarchy.
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
*It allows access to a new item created by using CreateItem.
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
*It provides methods accessing certain special default folders directly.
|-  VALIGN=TOP
*It provides the Entry Point for establishing the connection
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EndDate</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Date</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>StartDate</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Date</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Location</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 17.
AppointmentItem Properties</I></FONT></P>


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
=== Using the AppointmentItem Object ===
!|Name
The following example shows how to create a new Appointment.
!|Type
{| WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
!|Description
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
|-
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
|Application||IApp||Readonly: Reference to  the  App Object itself.
Create a new Appointment</SPAN></SPAN></P>
|-
|-
|Name||Variant||Readonly: Name of  the Application.
| WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
|-
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment:
|Session||ISession||Readonly: Reference to the  current Session Object.
AppointmentItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment
|-
:= Application.CreateIem(olAppointmentItem) as AppointmentItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment.Subject
|Version||Variant||Readonly: Number of the current Version
:= 'Meeting';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment.StartDate
:= StrToDateTime('01.01.2007 15:00);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment.EndDate
:= StrToDateTime('01.01.2007 15:00);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>NewAppointment.Save;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}
|}


<center>App Properties</center><br/>
== ContactItem Object ==
Represents a contact in a contacts folder. A contact can represent any person with whom you have any personal or professional contact. A ContactItem posses properties described in Table 15 and Table 18, methods described in Table 16. A valid Value in LastName property is required for saving.


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
{| WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=67*><COL WIDTH=32*><COL WIDTH=157*>  VALIGN=TOP
!|Name
|  WIDTH=26% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
!|Result
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
!|Parameters
|  WIDTH=61% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
!|Description
|-  VALIGN=TOP
|-
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EmailAddress1</FONT></P>
|CreateItem||IItem||Item: OlDefaultItems||Creates a new item and returns it. The CreateItem method can only create items listet in Table 1
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|-
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:.first
|CreateRecipient||IRecipient||Value: Variant||Creates and returns a Recipient object.
email</FONT></P>
|-
|-  VALIGN=TOP
|GetDefaultFolder||IMAPIFolder||Name: OlDefaultFolders||Returns a MAPIFolder object that represents the default folder of the requested type for the current profile. Default folders are described in  Table 2
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>BusinessTelephoneNumber</FONT></P>
|-
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|GetFolderFromID||IMAPIFolder||ID: Variant||Returns a MAPIFolder object identified by the specified entry ID (if valid).
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
|-
Telephonenumber</FONT></P>
|Quit|| || ||The associated session is closed completely; the user is logged out of the messaging system and any changes to items not already saved are discarded.
|-  VALIGN=TOP
|}
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>FirstName</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
First name</FONT></P>
|-  VALIGN=TOP
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>LastName</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:.Last
name</FONT></P>
|-  VALIGN=TOP
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Company</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Writ:
Company</FONT></P>
|-  VALIGN=TOP
|  WIDTH=26% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HomeAddressCity</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=61% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
City of Home Address</FONT></P>
|}<P CLASS="western" ALIGN=CENTER><I>Table 18. ContactItem Properties</I></P>
 
=== Using the ContactItem Object ===
The following example shows how to create a new Contact.
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
Create a new Contact</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact:
ContactItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact
:= Application.CreateIem(olContactItem) as ContactItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.FirstName
:= 'John';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.LastName
:= 'Smith';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.EmailAddress1
:= 'john.smith@acme.com'</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.Save;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western"><BR><BR></P>
 
== DistListItem Object ==
Represents a distribution list in a contacts folder. A distribution list can contain multiple recipients and is used to send messages to everyone in the list.
A DistListItem posses properties described in Table 15 and Table 19, methods described in Table 16
and Table 20. A valid Value in the Subject property is required.
 
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MembersCount</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>long</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ReadOnly:.Number
of Members in the Distributionlist</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Members</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
| WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:Array
of string containing each member of the Distributionlist. The
string format is ***Name***/n/r***Mailaddress***</FONT></P>
|}<P CLASS="western" ALIGN=CENTER><I>Table 19. DistListItem Properties</I></P><P CLASS="western" ALIGN=CENTER><BR><BR></P>
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=43*><COL WIDTH=32*><COL WIDTH=91*><COL WIDTH=89*>  VALIGN=TOP
|  WIDTH=17% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=12% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Result</B></P>
| WIDTH=36% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Parameters</B></P>
| WIDTH=35% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|- VALIGN=TOP
| WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>AddMember</FONT></P>
| WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
| WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Recipient:
IRecipient</FONT></P>
| WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Adds a
new Member to the Disptributionlist.</FONT></P>
|- VALIGN=TOP
| WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>GetMember</FONT></P>
| WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>IRecipient</FONT></P>
| WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
| WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Returns
a Recipient positioned at the index.</FONT></P>
|- VALIGN=TOP
| WIDTH=17% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>RemoveMember</FONT></P>
|  WIDTH=12% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>HRESULT</FONT></P>
| WIDTH=36% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Index:
long</FONT></P>
| WIDTH=35% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Deletes
Member from the Distributionlist</FONT></P>
|}<P ALIGN=CENTER STYLE="margin-top: 0.21cm"><FONT SIZE=3><I>Table 20.
DistListItem Methods</I></FONT></P>
 
=== Using theDistListItem Object ===
The following example shows how to create a new Distributionlist. Use the CreateRecipient method to create a Recipient and add it to the Distributiolist.
 
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
|  WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
Create a new Distributionlist</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newdistlist:
DistlistItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newrecipient:
Recipient;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newdistlist
:= Application.CreateItem(olContactItem) as DistListItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newrecipient
:= Application.CreateRecipient('John Smith');</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newdistlist.Subject
:= 'Businesspartners';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newrecipient.Address
:= <A HREF="mailto:'john.smith@acme.com">'john.smith@acme.com</A>';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newdistlist.AddMember(Newrecipient);</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newdistlist.Save;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western"><BR><BR></P>
 
== TaskItem Object ==
Represents a task (an assigned, delegated, or self-imposed task to be performed within a specified time frame) in a Tasks folder. A TaskItem posses properties described in Table 15 and Table 21, methods described in
Table 16.
 
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
| WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
|  WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
|  WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EndDate</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Date</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
End date</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>StartDate</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Date</FONT></P>
| WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
Start date</FONT></P>
|-  VALIGN=TOP
| WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Importance</FONT></P>
| WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>long</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
Priority of the Item. 0 = low, 1 = middle, 2 = high</FONT></P>
|}<P CLASS="western" ALIGN=CENTER><I>Table 21. TaskItem Properties</I></P><P STYLE="margin-top: 0.42cm; font-style: normal; page-break-after: avoid"><FONT FACE="Arial, sans-serif"><FONT SIZE=4>Using the TaskItem Object</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal; text-decoration: none">
The following example shows how to create a new Task.</P>
{|  WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0<COL WIDTH=256*>
| WIDTH=100% VALIGN=TOP | <P CLASS="western" STYLE="font-style: normal"><U>Delphi code
example:</U><SPAN STYLE="font-weight: medium"><SPAN STYLE="text-decoration: none">
Create a new Task</SPAN></SPAN></P>
|-
|  WIDTH=100% VALIGN=TOP BGCOLOR="#e6e6e6" | <P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>var</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Application:
App;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newtask:
TaskItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>begin</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact
:= Application.CreateIem(olContactItem) as ContactItem;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.FirstName
:= 'John';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.LastName
:= 'Smith';</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.EmailAddress1
:= 'John.Smith@acme.com'</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>Newcontact.Save;</FONT></FONT></P><P CLASS="western" STYLE="font-style: normal"><FONT FACE="Courier New, monospace"><FONT SIZE=2>end;</FONT></FONT></P>
|}<P CLASS="western" STYLE="font-style: normal; text-decoration: none"><BR><BR></P>
 
== Recipient Object ==
Represents a user or resource, generally a mail message addressee.
 
{|  WIDTH=100% BORDER=1 BORDERCOLOR="#000000" CELLPADDING=4 CELLSPACING=0 align="center" <COL WIDTH=40*><COL WIDTH=63*><COL WIDTH=152*>  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Name</B></P>
| WIDTH=25% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Type</B></P>
| WIDTH=60% | <P CLASS="western" ALIGN=CENTER STYLE="font-style: normal"><B>Description</B></P>
|-  VALIGN=TOP
| WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>EntryID</FONT></P>
| WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ReadOnly:
</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Address</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Name</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:
</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Session</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ISession</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Readonly:
Reference to the current Session Object.</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>MailField</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Read/Write:</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>FirstName</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ReadOnly:</FONT></P>
|-  VALIGN=TOP
|  WIDTH=16% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>LastName</FONT></P>
|  WIDTH=25% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>Variant</FONT></P>
|  WIDTH=60% | <P CLASS="western" STYLE="font-style: normal"><FONT SIZE=2>ReadOnly:</FONT></P>
|}<P CLASS="western" ALIGN=CENTER><I>Table 22. Recipient Properties</I></P>
 
=== Using the Recipient Object ===
An example how to use the the Recipient Object is described in the DistListItem Object module.


<center>App Methods</center><br/>


{| border="1" cellpadding="0" style="text-align:center" align="center" cellpadding="2"
!|Name
!|Result
!|Parameters
!|Description
|-
|Delete||HRESULT|| ||Deletes the folder
|-
|MoveTo||HRESULT||DestinationFolder: MAPIFolder||Moves the folder to the specified destination folder
|}


<center>MAPIFolder Methods</center><br/>


=== Using the MAPIFolder Object ===


This example uses the GetDefaultFolder method to obtain the default Calendar folder for a user who is currently logged in. Use OlDefaultFolders described in Table 2 to obtain the default folder.<br/>


'''Delphi code example:''' GetDefaultFolder<br/>
[[Category: OX6]]
<code>
<pre>
var
  Application: App;
  Folder: MAPIFolder;
begin
  Folder := App.GetDefaultFolder(olFolderCalendar);
end;
</pre>
</code>

Latest revision as of 01:56, 27 June 2009

Introduction

This document defines OXMAPI32 API. It provides access to a Open-Xchange 6 Server by using the Open-Xchange HTTP API. The OXMAPI32 API can be used for Windows applications. The OXMAPI32 API architecture bases on the Microsoft MAPI so the convention of constants and objects are similar.
This document describes the functionality of each object in the respective module, which are ordinated corresponding the object model. Each module provides code examples how to use the respective object written in Delphi.

OXMAPI Object Model

<IMG SRC="oxmapi32_html_m7b3028d.png" NAME="Grafik1" ALIGN=LEFT WIDTH=642 HEIGHT=238 BORDER=0>

Constants

This topic provides a list of all constant in the object model. OlDefaultFolders relate to the default folder subordinated to the private folder of the current user.

Name

Value

OlAppointmentItem

1

olContactItem

2

OlDistributionListItem

7

olTaskItem

3

Table 1. OlItemType


Name

Value

olFolderCalendar

9

olFolderContacts

10

olFolderlTasks

13

Table 2. OlDefaultFolders



Name

ID

private

1

public

2

shared

3

Table 3. top level folder IDs

App Object

Represents the root for any data source object. The App Object has several purposes:

  • As the root object, it allows access to other objects in the oxmapi hierarchy.

  • It allows access to a new item created by using CreateItem.

  • It provides methods accessing certain special default folders directly.

  • It provides the Entry Point for establishing the connection


Name

Type

Description

Application

IApp

Readonly: Reference to the App Object itself.

Name

Variant

Readonly: Name of the Application.

Session

ISession

Readonly: Reference to the current Session Object.

Version

Variant

Readonly: Number of the current Version

Table 4. App Properties




Name

Result

Parameters

Description

CreateItem

IItem

Item: OlDefaultItems

Creates

a new item and returns it. The CreateItem method can only create

items listet in Table 1

CreateRecipient

IRecipient

Value: Variant

Creates and returns a Recipient object.

GetDefaultFolder

IMAPIFolder

Name: OlDefaultFolders

Returns

a MAPIFolder object that represents the default folder of the requested type for the current profile. Default folders are

described in Table 2

GetFolderFromID

IMAPIFolder

ID: Variant

Returns

a MAPIFolder object identified by the specified entry ID (if

valid).

Quit



The

associated session is closed completely; the user is logged out of the messaging system and any changes to items not already saved

are discarded.

Table 5. App Methods


Using the App Object

Use the CoClass.Create method to instantiate a new Application.

Delphi code example:

var

Application: App;

begin

Application := CoApp.Create;

Examples showing how to use the functions of the App Object are described in the corresponding module. An example for a folder request is presented in the module of the MAPIFolder object. An example how to create items is presented in the module of the Item Interface .

Session Object

Represents a connection to the OX-Server. The object itself provides methods for logging in and out. The Logon Method requires a valid IP-Address to the server.

Name

Type

Description

Parent

IApp

Readonly: Reference to the current App Object.

Session

ISession

Readonly: Reference to the Session Object itself.

Connected

WordBool

Readonly:

Flag which indicates whether Session is connected to the server

or not.

Table 6. Session Properties


Name

Result

Parameters

Description

SetIP

HRESULT

Value: Variant


Logon

HRESULT

Username, Password: Variant

Logs the user on to MAPI, obtaining a MAPI session.

Logoff

HRESULT


Logs the user off from the current MAPI session.

Table 7. Session Methods

Using the Session Object

To establish a connection to the server, use the following example:

Delphi code example: Connection

var

Application: App;

begin

Application.Session.SetIP('192.168.0.1');

Application.Session.Logon;



MAPIFolder Object

Represents a folder. A MAPIFolder object can contain other MAPIFolder objects, as well as items. Therefore the MAPIFolder Object contains the Folders Object and the Items Object to obtain subordinated elements. You can navigate nested folders by using a combination of Folders.item(index), which returns the subfolder with the position of the index.

The MAPIFolder Object is typed; for example, the Calendar folder will only contain AppointmentItem objects and the Contacts folder will only contain ContactItem and DistListItem objects.



Name

Type

Description

Application

IApp

Readonly: Reference to the current App Object.

EntryID

Variant

Readonly: Folder ID of corresponding folder on the server.

Parent

IMAPIFolder

Readonly:

Reference to the Parentfolder. If the current folder is a root folder (private folder, public folder, shared folder or infostore)

this property returns null.

Session

ISession

Readonly: Reference to the current Session Object.

Folders

IFolders

Readonly:

Folders Object representing all subfolders contained in this

folder.

Items

IItems

Readonly: Items Object representing all items contained in this folder.

Name

Variant

Read/Write: Name of the folder.

Category

Variant

Readonly: Category of the folder.

Table 8. MAPIFolder Properties



Name

Result

Parameters

Description

Delete

HRESULT


Deletes the folder

MoveTo

HRESULT

DestinationFolder: MAPIFolder

Moves the folder to the specified destination folder

Table 9. MAPIFolder Methods

Using the MAPIFolder Object

This example uses the GetDefaultFolder method to obtain the default Calendar folder for a user who is currently logged in. Use OlDefaultFolders described in Table 2 to obtain the default folder.

Delphi code

example:

GetDefaultFolder

var

Application: App;

Folder: MAPIFolder;

begin

Folder := App.GetDefaultFolder(olFolderCalendar);

end;



The default folders constants provides access to the private default folders. To obtain a top level folder, use the GetFolderFromID method. The following example shows how to obtain the private folder.

Delphi code

example:

GetFolderFromID

var

Application: App;

Folder: MAPIFolder;

begin

Folder := App.GetFolderFromID('1');

end;

To add a new folder, use the add method of the Folders property. An example how to add a folder is presented in the Folders Object module. To add a new item, use the add method of the Items property. An example how to add a item is presented in the Items Object module.

Folders Object

Represents all folders in a MAPIFolder object. The Folders Object provides a collection of methods to obtain subordinated folders.

Name

Type

Description

Application

IApp

Readonly: Reference to the current App Object.

Parent

IMAPIFolder

Readonly: Reference to the MAPIFolder Object.

Session

ISession

Readonly: Reference to the current Session Object.

Count

Long

Readonly:Number of subfolders contained in the Parent MAPIFolder

Table 10. Folders Properties



Name

Result

Parameters

Description

Add

MAPIFolder

Name: Variant, Type_: OlDefaultFolders

Creates a new folder in the Parent MAPIFolder.

Find

MAPIFolder

Filter: Variant

Locate and returns a direct subfolder

GetFirst

MAPIFolder


Returns the first subfolder

GetLast

MAPIFolder


Returns the last subfolder

GetNext

MAPIFolder


Returns

the next subfolder. It returns null if no next subfolder exists,

if already positioned at the last folder.

GetPrevious

MAPIFolder


Returns

the previous subfolder. It returns null if no previous subfolder

exists, if already positioned at the first folder.

Item

MAPIFolder

Index: long

Returns a subfolder positioned at the index number.

Remove

HRESULT

Index: long

Deletes a subfolder positioned at the index number

Table 11. Folders Methods



Using the Folders Object

This example uses the item method to visit subordinated folders and returns the folder “old contacts”.

Delphi code

example:

visit subfolders

Var

i: integer;

Application: App;

Contactfolder, Folder: MAPIFolder;

begin

Contactfolder := App.GetDefaultFolder(olFolderCalendar);

for i := 0 to Contactfolder.Count-1

begin

Folder := Contactfolder.folders.item(i);

if (Folder.Name = 'old contacts') then

begin

Result := Folder;

end

else

begin

Result := nil;

end;

end;

end;




To add a new folder, use the add method. The Add method has an optional argument that can be used to specify the type of items that can be stored in that folder. By default, folders created inside another folder inherit the type of the parent folder.

Delphi code

example:

add a new folder

var

Application: App;

newfolder, Contactfolder: MAPIFolder;

begin

Contactfolder := App.GetDefaultFolder(olFolderCalendar);

newfolder

:= Contactfolder.Folders.add('new

contactfolder',olFolderContacts);

end;


Items Object

Represents all Items in a MAPIFolder object. The Items Object provides a collection of methods to obtain subordinated folders.

Name

Type

Description

Application

IApp

Readonly: Reference to the current App Object.

Parent

IMAPIFolder

Readonly: Reference to the MAPIFolder Object.

Session

ISession

Readonly: Reference to the current Session Object.

Count

Long

Readonly:Number of Items contained in the Parent MAPIFolder

Table 12. Items Properties



Name

Result

Parameters

Description

Add

IItem

Name: Variant, Type_: OlDefaultItems

Creates

a temporary Item in the Parent MAPIFolder. To create a persistent

item, invoke the save method of the item.

Find

IItem

Filter: Variant

Locate and returns a Item matching the Filter.

GetFirst

IItem


Returns the first Item.

GetLast

IItem


Returns the last Item.

GetNext

IItem


Returns

the next Item. It returns null if no next Item exists, if already

positioned at the last Item.

GetPrevious

IItem


Returns

the previous Item. It returns null if no previous Item exists, if

already positioned at the first Item.

Item

IItem

Index: long

Returns a Item positioned at the index number.

Remove

HRESULT

Index: long

Deletes a Item positioned at the index number.

Table 13. Items Methods



Using the Items Object

This example uses the item method to obtain items contained in the parent folder.

Delphi code

example:

obtaining folder items

Var

i: integer;

Application: App;

Contactfolder: MAPIFolder;

Currentitem: Item;

begin

Contactfolder := App.GetDefaultFolder(olFolderCalendar);

for i := 0 to Contactfolder.Count-1

begin

Currentitem := Contactfolder.items.item(i);

if (Currentitem.Subject = 'John Smith') then

begin

Result := Current;

end

else

begin

Result := nil;

end;

end;

end;

To

add a new item, use the add method. The Add method has an optional argument that can be used to specify the type of the item. By default, items created inside the parent folder inherit the type by means of the parent folder. In the case a contact folder adds a new item, the result is an Item interface referring to a ContactItem

Object.

The

Add method creates a temporary and specific item. To make it

persistent, it needs to be saved by invoking the Save method.

Delphi code

example:

add a new item

var

Application: App;

Contactfolder: MAPIFolder;

Newitem: Item;

begin

Contactfolder := Application.GetDefaultFolder(olFolderContacts);

Newitem := Contactfolder.Items.add(olContactItem);

Newitem.Subject := 'John Smith';

Newitem.Save;

end;


Item Interface

The Item interface is a common Interface to handle basic functions of a specific item object and to abstract the specific items.

The Item interface is the root for all specific item interfaces; for example, a ContactItem interface inherits the properties and methods of the Item interface.

To

identify an item, use the Message Class property. Message Class

Values are described in Table 14.



MessageClass

IPM.Appointment

IPM.Contact

IPM.DistList

IPM.Task

Table 14. MessageClasses



Name

Type

Description

Application

IApp

Readonly: Reference to the current App Object.

EntryID

Variant

Readonly: ID of corresponding item on the server.

Parent

IMAPIFolder

Readonly:

Reference to the Parentfolder. If the current folder is a root folder (private folder, public folder, shared folder or infostore)

this property returns null.

Session

ISession

Readonly: Reference to the current Session Object.

CreationTime

Date


Body

Variant

Readonly: Items Object representing all items contained in this folder.

Subject

Variant

Read/Write: Name of the folder.

Saved

Wordbool

Readonly: indicates whether the save method has been successfull.or not

MessasgeClass

Variant


Table 15. Item Properties



Name

Result

Parameters

Description

Delete

HRESULT


Deletes the item

Move

HRESULT

DestinationFolder: MAPIFolder

Moves the item to the specified destination folder

Save

HRESULT


Stores

a new item on the server or updates the existing one. If required

properties are not set, the Save method will fail.

Table 16. Item Methods

Using the Item Interface

The following example shows how to create a new Appointment in the default calendar folder. To use the new item as Appointment, the Item interface has to be casted to an AppointmentItem.

Remark: Like the Add method in the Items Object, CreateItem also creates a temporary item. To make it persistent, the Save method has to be invoked.

Delphi code

example:

CreateItem

var

Application: App;

Newitem: Item;

NewAppointment: AppointmentItem;

begin

Newitem := Application.CreateIem(olAppointmentItem);

NewAppointment := Newitem as AppointmentItem;

end;

AppointmentItem Object

Represents an appointment in the Calendar folder. An AppointmentItem posses properties described in Table 15 and Table 17, methods described in Table 16. Valid Values in Subject, StartDate and EndDate properties are required for saving.

Name

Type

Description

EndDate

Date

Read/Write:

StartDate

Date

Read/Write:

Location

Variant

Read/Write:

Table 17. AppointmentItem Properties

Using the AppointmentItem Object

The following example shows how to create a new Appointment.

Delphi code

example:

Create a new Appointment

var

Application: App;

NewAppointment: AppointmentItem;

begin

NewAppointment := Application.CreateIem(olAppointmentItem) as AppointmentItem;

NewAppointment.Subject := 'Meeting';

NewAppointment.StartDate := StrToDateTime('01.01.2007 15:00);

NewAppointment.EndDate := StrToDateTime('01.01.2007 15:00);

NewAppointment.Save;

end;

ContactItem Object

Represents a contact in a contacts folder. A contact can represent any person with whom you have any personal or professional contact. A ContactItem posses properties described in Table 15 and Table 18, methods described in Table 16. A valid Value in LastName property is required for saving.

Name

Type

Description

EmailAddress1

Variant

Read/Write:.first email

BusinessTelephoneNumber

Variant

Read/Write: Telephonenumber

FirstName

Variant

Read/Write: First name

LastName

Variant

Read/Write:.Last name

Company

Variant

Read/Writ: Company

HomeAddressCity

Variant

Read/Write: City of Home Address

Table 18. ContactItem Properties

Using the ContactItem Object

The following example shows how to create a new Contact.

Delphi code

example:

Create a new Contact

var

Application: App;

Newcontact: ContactItem;

begin

Newcontact := Application.CreateIem(olContactItem) as ContactItem;

Newcontact.FirstName := 'John';

Newcontact.LastName := 'Smith';

Newcontact.EmailAddress1 := 'john.smith@acme.com'

Newcontact.Save;

end;



DistListItem Object

Represents a distribution list in a contacts folder. A distribution list can contain multiple recipients and is used to send messages to everyone in the list. A DistListItem posses properties described in Table 15 and Table 19, methods described in Table 16 and Table 20. A valid Value in the Subject property is required.

Name

Type

Description

MembersCount

long

ReadOnly:.Number of Members in the Distributionlist

Members

Variant

Read/Write:Array

of string containing each member of the Distributionlist. The

string format is ***Name***/n/r***Mailaddress***

Table 19. DistListItem Properties



Name

Result

Parameters

Description

AddMember

HRESULT

Recipient: IRecipient

Adds a new Member to the Disptributionlist.

GetMember

IRecipient

Index: long

Returns a Recipient positioned at the index.

RemoveMember

HRESULT

Index: long

Deletes Member from the Distributionlist

Table 20. DistListItem Methods

Using theDistListItem Object

The following example shows how to create a new Distributionlist. Use the CreateRecipient method to create a Recipient and add it to the Distributiolist.

Delphi code

example:

Create a new Distributionlist

var

Application: App;

Newdistlist: DistlistItem;

Newrecipient: Recipient;

begin

Newdistlist := Application.CreateItem(olContactItem) as DistListItem;

Newrecipient := Application.CreateRecipient('John Smith');

Newdistlist.Subject := 'Businesspartners';

Newrecipient.Address := <A HREF="mailto:'john.smith@acme.com">'john.smith@acme.com</A>';

Newdistlist.AddMember(Newrecipient);

Newdistlist.Save;

end;



TaskItem Object

Represents a task (an assigned, delegated, or self-imposed task to be performed within a specified time frame) in a Tasks folder. A TaskItem posses properties described in Table 15 and Table 21, methods described in Table 16.

Name

Type

Description

EndDate

Date

Read/Write: End date

StartDate

Date

Read/Write: Start date

Importance

long

Read/Write: Priority of the Item. 0 = low, 1 = middle, 2 = high

Table 21. TaskItem Properties

Using the TaskItem Object

The following example shows how to create a new Task.

Delphi code

example:

Create a new Task

var

Application: App;

Newtask: TaskItem;

begin

Newcontact := Application.CreateIem(olContactItem) as ContactItem;

Newcontact.FirstName := 'John';

Newcontact.LastName := 'Smith';

Newcontact.EmailAddress1 := 'John.Smith@acme.com'

Newcontact.Save;

end;



Recipient Object

Represents a user or resource, generally a mail message addressee.

Name

Type

Description

EntryID

Variant

ReadOnly:

Address

Variant

Read/Write:

Name

Variant

Read/Write:

Session

ISession

Readonly: Reference to the current Session Object.

MailField

Variant

Read/Write:

FirstName

Variant

ReadOnly:

LastName

Variant

ReadOnly:

Table 22. Recipient Properties

Using the Recipient Object

An example how to use the the Recipient Object is described in the DistListItem Object module.