The big picture: A .docx file is actually a ZIP archive containing XML files. The program unzips the document, finds your {{placeholders}} in the XML, swaps them with values from your JSON, then ...