Skip to main content

Word

16 commands. Toolkit id ooa.word.

CommandWhat it does
Add paragraphAppend a paragraph, optionally bold or with a style such as Heading1.
CloseClose the document, saving the changes first when asked.
Create documentCreate a new .docx (or .doc, .rtf or .odt) file on disk, empty or as a copy of a template document, optionally password-protected, and open it as a named session.
Extract text from a fileReturn the whole text of a .doc, .docx or .rtf file without opening it as a session; old .doc and .rtf files included.
Find and replace pictureSwap an existing picture, found by its alternative text or its position in the document, for a new image file, optionally resizing it and changing its alternative text.
Find and replace textFind text everywhere (body, tables, headers, footers) or in a paragraph range, bookmark or page and count it, or replace it, e.g. fill {{customer}} placeholders; can ignore case, match whole words or take only the first or last occurrence.
Format textApply bold, italic, underline, strikethrough, highlight, font, size or colour to occurrences of a text in the document, a paragraph range, a bookmark or a page; inputs left empty are not changed.
Get page countCount the document's pages, from the page layout Word saved in the file or from its page and section breaks.
Insert pictureInsert an image file at the start or end of the document, after a marker text or at a bookmark, optionally sized and aligned.
Insert tableInsert a table built from a Data Table (header row first) at the end, after a marker text or at a bookmark, optionally with a table style.
Insert textInsert text, or HTML (headings, lists, tables, links, formatting and pictures), at the start or end of the document, or just before or after a marker text or a bookmark, optionally with its own font formatting.
Open documentOpen a .docx, .doc, .rtf or .odt document, or create a new one, as a named session; can open password-protected .docx files, check the password to edit and open read-only. .doc, .rtf and .odt files are converted with Word or LibreOffice on the runner and saved back in their own format.
Read tablesRead every table in the document, one table by position or one table by its title, optionally only some of its rows and columns; the first row read can become the column names.
Read textReturn the paragraph text, one paragraph per line, of the whole body, a range of paragraphs, the text inside a bookmark or one page, optionally with tables, headers and footers.
SaveSave the document, optionally to a new path; password-protected documents stay protected.
Save asSave the document to a new .docx, .doc, .rtf or .odt file (.docx optionally password-protected) and continue the session on it, or export it as PDF or its text as a .txt file.