Create a .docx
docx_createGenerate a new Word .docx from plain text paragraphs with optional styles and title. Avoids overwriting by failing if the path exists.
Instructions
Create a new Microsoft Word .docx document from plain text.
Each paragraph is either a string, or an object {text, style} where style is a Word style id such as Heading1, Heading2 or Title. The produced file is a valid OOXML package that opens in Word, WPS and LibreOffice.
Fails if the target path already exists — pick another path instead of overwriting by accident.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Where to create the new .docx. | |
| title | No | Document title (stored as document properties). | |
| paragraphs | Yes | Paragraphs in order. Either a plain string, or {text, style}. |