DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can have placegholder text in a .docx file and how I can replace it?

In php I need to read a .doxc file and replace some fields with a content. Though I have no idea on how to tackle this issue using php.

Usually I need to fill forms from a base document as a template stored in .docx format.

So far I know hopw to read a .docx file using PHPWord: https://github.com/PHPOffice/PHPWord/blob/develop/samples/Sample_11_ReadWord2007.php

But Idk how to replace content as I ask on:

I have a .docx file and I want to replace any text marked as <<content>> with a specific string. My project is in php but I have no idea using phpoccide how I can do that.I found the following example used for reading a .docx document.

The problem though how…

Can you offer me some help?

Top comments (1)

Collapse
 
mattother profile image
mattother

Seem to have already been covered here: stackoverflow.com/questions/412962...