Microsoft Office Outlook Library

The Microsoft Office Outlook integration library is a collection of functions used to manage Microsoft Outlook.

For more details, see Microsoft Outlook Extension.

Including the Library

Make sure the library ctx.outlook is included in the project:

Initialize the Outlook Application

To enable the manipulation of Outlook mails, Microsoft Outlook Library must be initialized using the ctx.outlook.init() method.

init

Initializes the Outlook Application

Once an instance of Outlook is initialized, all methods are accessible and can be used.

End the Outlook Process.

end

Ends the Outlook library

At the end of Outlook processing, the Outlook application used should be ended properly.

Retrieve Mails

To retrieve mails from Outlook application, the following steps must be performed:

resetMailCollection

The mails will be stored in the working mails list, so it's important to reset this list and make that it’s empty, because the working mails list may contain mails searched for previously.

search

Search mails using filter containing the details of searching for mails.

getFilteredTable

Gets the filtered table that contains the searched mails but without full details of each mail.

retrieveMail

Retrieves mails stored in the filtered table using the “EntryID” and “StoreID”, and then builds the working mails list with the retrieved mails.

The following example shows how to retrieve the Unread Mails from Outlook using the methods mentioned above and complying with the steps involved in mail retrieval.

The following example is about how to retrieve mails received between “January 21, 2018” and “February 12, 2018” and sent by “hismail@example.com” using the searchByCriteria function.

Send Mails

To send mails from Outlook, you need to use the following methods:

create

Creates a new mail using object as parameter and pushes it to mail collection

send

Sends mail and removes the mail from the working mail collection.