Page 1 of 1

Programmatically headless search and replace

Posted: Thu Mar 15, 2018 2:17 pm
by gersonfs
Hello!

I need to use find and replace via headless, but I have not found a way to do that.
Currently I uncompressed a .docx file and try to locate and replace it directly in the xml file, but often there are tags being opened and closed in the middle of my search string.

I have a template .docx file, and I need to replace certain strings with others, for example a lease, where I need to put name, address and other information via programming.

How i can do it?

Re: Programmatically headless search and replace

Posted: Thu Mar 15, 2018 2:38 pm
by RoryOF
You could use User defined fields; see this article for some helpful information
https://www.techrepublic.com/blog/linux ... penoffice/

I am not certain that "headless" is the way to go - there might be too many substitute fields for convenient and reliable handling.

Re: Programmatically headless search and replace

Posted: Thu Mar 15, 2018 2:44 pm
by gersonfs
Thanks RoryOF

Any bookmark / variable that I could find directly in the file word / document.xml would already work perfectly.

Re: Programmatically headless search and replace

Posted: Thu Mar 15, 2018 3:15 pm
by gersonfs
I'm looking to use mono + openxml SDK on CentOS