Edit_Word_Document
Update Word documents by replacing placeholders or entire sections (bullets, tables) to automate monthly status reports while preserving formatting.
Instructions
Edit an existing Word document (.docx) with find/replace operations and SECTION REPLACEMENT for monthly status reports. Preserves all formatting.
SIMPLE REPLACEMENT: Replace individual placeholders ({{company_name}} -> 'Acme Corp')
SECTION REPLACEMENT FOR MONTHLY REPORTS: Replace entire sections (8 bullets, tables) in one operation.
Perfect for monthly status reports where sections need to be updated each month
Use section markers: {{section:name}} ... {{/section:name}}
Replace all content between markers with fresh bullet points or table rows
Preserves formatting and list styles
USE CASES:
Monthly status reports: Replace {{section:status_bullets}} with 8 new status items
Metrics tables: Replace {{section:metrics}} with updated monthly data
Template filling: Replace {{company_name}} and other placeholders with actual values
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the existing Word document in SharePoint | |
| replacements | Yes | Array of replacement operations. Supports TWO FORMATS: 1. SIMPLE REPLACEMENT (single placeholder): {"find": "{{company_name}}", "replace": "Acme Corp"} 2. SECTION REPLACEMENT (for monthly reports - replaces entire sections like 8 bullets): { "find": "{{section:status_bullets}}", "replace_section": ["Item 1", "Item 2", "Item 3", ...], "section_type": "bullets" } Template must have section markers: {{section:status_bullets}} * Old bullet 1 * Old bullet 2 {{/section:status_bullets}} Section types: "bullets" (for bullet lists) or "table" (for tables) | |
| output_file_path | No | Optional: Path for the modified document. If not provided, overwrites the original file. |