Batch generation from a template
A spreadsheet becomes one document per row: each variable field of the template is a tagged content control, filled in the body, header and footer, without Word open.
Deliverable: documents + manifest with sha256Octo for Word documents
A .docx is a package of XML. Filling a template, merging data, counting revisions, checking alt text, removing the name of whoever edited and generating PDF can all be done by script, without opening Word, and Word through COM is kept for comparing versions and exporting PDF/A on a workstation. Octo generates in batch with a manifest, audits before converting and validates every PDF. Text, signature, accepting revisions and publishing stay with the document owner.
?format=pdfSix possible deliverables, drawn from the research. All of them work on copies, leave a manifest or report, and end up on the document owner's desk.
A spreadsheet becomes one document per row: each variable field of the template is a tagged content control, filled in the body, header and footer, without Word open.
Deliverable: documents + manifest with sha256A row without a required field, a control still holding the placeholder text or a column without a control in the template stops the document before it exists.
Deliverable: list of blocks for whoever maintains the spreadsheetCompareDocuments generates a third file with what the other party changed, attributed to a name, without touching either version; the script counts insertions, deletions, moves and formatting changes.
Export with UseISO19005_1 and structure tags on a workstation, or conversion through Graph up to 2 MB, and always veraPDF afterward, with a report per file.
Images without alt text, tables without headers, controls without titles and documents without heading styles, following the published Accessibility Checker rules.
Deliverable: open issues per file; final check in WordPersonal author, last saved by, template on a network path, custom properties, comments, pending revisions, hidden text and macros, without opening Word.
Deliverable: audit in CSV, nothing deleted blindlyThe same Octo cycle, applied to documents. Each arm has a narrow role; the ones who write the clause, accept the revision, sign and publish are people.
Templates in use, the Office version on each workstation (2016, 2019 and 2021/LTSC 2021 out of support), where the documents live and who generates them.
Source spreadsheet, required columns and the column → content control tag mapping.
Graph token outside the code, minimum permission, macros disabled in the automation, people's names out of the metadata; personal data flagged (LGPD).
Files directly on a server, Graph for conversion up to 2 MB, COM only on a workstation with a user, Power Automate when the flow is already there.
Generators, auditors and converters with a manifest, sha256 and the source of each syntax noted in the file.
No empty field, no pending revision, veraPDF passed and a sample opened in Word. "The file was generated" is not a check.
Documents, PDFs and reports ready. Publishing, filing and sending are done by a person.
Template and spreadsheet used, manifest, validation report, who approved and where each file ended up.
Octo works on copies and delivers for review. It does not write clauses on its own, does not sign, does not accept revisions, does not send email and does not publish documents.
The criteria Octo uses to choose, with the official reference for each path.
| Task | Path | Notes |
|---|---|---|
| Generate hundreds of documents from a template | Content controls + python-docx or Open XML SDK | Runs on a server, without Word |
| Template with loops and conditions | docxtpl (Jinja2) | LGPL-2.1 license |
| Fill a template inside a flow | Power Automate, "Populate a Microsoft Word template" | Premium; 10 MB; no rich text, date or checkbox |
| Classic mail merge | MailMerge.Execute(False) through COM | Workstation with a user |
| Compare versions | CompareDocuments, new destination | Both versions stay intact |
| Count revisions and comments | Reading w:ins, w:del, w:moveFrom, w:moveTo, w:rPrChange and the like, comments.xml | In batch, without Word: insertions, deletions, moves and formatting changes |
| PDF for preview | Graph GET .../content?format=pdf | Up to 2 MB; 302 to a URL valid for a few minutes |
| PDF/A for archiving | ExportAsFixedFormat with UseISO19005_1 | Always validate with veraPDF |
| Accessibility pre-screening | Reading the XML by the Checker's rules | Final check in Word |
| Clean metadata | core_properties or RemoveDocumentInformation | Do not remove revisions blindly |
| Read controls of the open document | Office.js, Word.ContentControl (WordApi 1.1) | Add-in, not batch |
Three steps. Each one only makes sense after the previous one has shown results on your team.
A proposal, not a promise
Octo reads the documents that are already published and shows what goes along with them, without changing anything.
The most used templates get content controls with tags and titles, and the spreadsheet becomes documents.
Batch conversion and validation, with a report per file and approval logged before archiving or publishing.
Every point below has a source published by Microsoft (Learn and Support), by the package's official repository (PyPI, NuGet, PowerShell Gallery) or in Brazilian federal law. The examples are scripts to follow, not runs. The sources are in the next section.
4
points with a published source, each with its reference shown alongside.
?format=pdf accepts files up to 2 MB and responds with a 302 to a pre-authenticated URL valid for a few minutes; minimum delegated permission Files.Read.Source: Graph v1.0, driveItem get content formatOcto prepares everything, but it does not sign. The document of record stays with whoever is accountable for it.
Surveys, organizes and produces the files: documents, spreadsheets, presentations, schedules, inventories and check reports, on file and through the APIs, without sending or publishing anything.
Deliverable: material ready to checkWhoever is accountable for the document, the spreadsheet or the schedule checks what Octo delivered before approving. If something doesn't add up, it goes back to Octo with the correction.
Step: checked by the person accountableOcto does not sign, approve or send. The document owner reviews and signs; the project manager approves the baseline; the Microsoft 365 administrator grants consent for permissions; the data protection officer approves anything that goes out with personal data.
Approval: document owner and 365 administratorMicrosoft documentation (lifecycle, Word VBA reference, Graph, Office.js, connectors and support), library and veraPDF pages and Law 14.063/2020, consulted on Oct 31, 2026.
The assessment starts with a read-only audit of the documents your team already publishes. You get the list of what is going out along with them, the templates that could be batched and the questions only your team can answer, and you decide with that in hand.