Skip to content

Outlook Close

Type: outlook-close  ·  Package: Outlook Activities v1.0.4

Closes a session opened with Outlook Connect. It is only needed when you used Connect without body (session stored in an output variable).

Releases the Outlook connection held by the given session. If you omit session, it closes the session inherited from the Outlook Connect body. It does not close the Outlook window and does not touch any email. After this, the session can no longer be used; closing the same session twice has no effect.

None.

ParameterTypeDefaultDescription
sessionZoanOutlookSession—The session returned by Outlook Connect. Inside the Connect body it is inherited automatically.

This activity does not return a value.

MessageCause and fix
'session' must be a ZoanOutlookSession.No valid session was passed and none is inherited. Pass the variable returned by Outlook Connect (session = outlook).
Outlook Connect account = "support@company.com" → output: outlook
Try / Catch
├─ try:
│ Outlook Get Emails session = outlook folder = "Inbox" → output: emails
│ Log message = count(emails) + " pending emails"
└─ finally:
Outlook Close session = outlook