Hello,
We recommend you to do it in two steps: first create a document, import the headers/footers and save it; and then open it again using the CreateDocxFromTemplate class and replace the placeholders
The method replaceVariableByText is not available in the CreateDocx class.
Regards.