Word Close (Session)
Word Close (Session)
Section titled “Word Close (Session)”Type: word-close · Package: Word Activities v1.0.4
Closes a Word session and releases the document from memory. It is the counterpart of Word Open / Word Create when you work without body.
How it works
Section titled “How it works”Releases the given session. After that, the session can no longer be used. Closing a session that was already closed raises no error. If you don’t set session, it closes the one of the enclosing body (not needed: the body closes it by itself).
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanWordSession | — | The session from Word Open or Word Create. |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Word Open path = asset("report.docx") → output: docWord Read Tables session = doc → output: tablesWord Set Property session = doc property = Category value = "Reviewed"Word Save session = docWord Close session = docCommon errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'session' must be a valid Word session (use word-open or word-create). | No session was passed (or the variable holds no session) and the activity is not inside a Word Open/Create body. |
Related activities
Section titled “Related activities”- Word Save — save before closing.
- Word Open / Word Create — open the session.