Arnis Lapsa
Arnis Lapsa

Reputation: 47647

How to substitute placeholders in word documents w/o office installed?

It might be acceptable to use rtf and just rename extension to doc/docx/whatever.

Upvotes: 1

Views: 318

Answers (1)

Adam Schmideg
Adam Schmideg

Reputation: 10860

I have a very simple solution without using .net. A docx file is just a bunch of xml files zipped together. So

  1. unzip file.docx
  2. replace placeholder in word/document.xml (or all xml files if the placeholder can be anywhere, like footnotes, etc.)
  3. zip them together, again with docx extension

Upvotes: 1

Related Questions