Word Save (Session)
Word Save (Session)
Section titled “Word Save (Session)”Type: word-save · Package: Word Activities v1.0.4
Saves to disk the changes of a Word session. You need it when you change a document opened with Word Open (with or without body), or to save a copy to another path (Save As).
How it works
Section titled “How it works”Writes the current in-memory state of the document. If you set path, it saves to that new path; if you omit it, it saves to the original path (the one from Word Open or Word Create).
- An existing file at the target path is overwritten; missing folders are created.
- Save As does not change the session’s path: a later Word Save without
pathsaves to the original path again. - The session stays open after saving; you can keep editing and save again.
- If you don’t set
session, it uses the one of the enclosing Word Open or Word Createbody.
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. Inherited automatically inside a body. |
path | string | — | Save to another path (Save As). Omit it to use the original path. |
Output
Section titled “Output”This activity does not return a value.
Example
Section titled “Example”Word Open path = asset("template.docx") → output: docWord Find & Replace session = doc find = "{CUSTOMER}" replace = customer.nameWord Save session = doc path = "C:/letters/" + customer.id + ".docx"Word 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 and the activity is not inside a Word Open/Create body. |
| File access error | The path is not valid, there is no write permission, or the file is open in Word or another program. Close it or save under another name. |
| Closed session error | The session was already closed with Word Close or when its body ended. Save before closing. |
Related activities
Section titled “Related activities”- Word Close — close the session.
- Word Create / Word Open — open the session.