Hi, I'm trying to replace a variable like ${target} in my .docx file with the content of another .docx file.
I tried it, for example, like this:
// load document that contains the target variable
WordprocessingMLPackage mainPackage = WordprocessingMLPackage.load(new File(mainPath));
VariablePrepare.prepare(mainPackage);
MainDocumentPart mainDocPart = mainPackage.getMainDocumentPart();
// load document that contains the content with which the target variable should be replaced
WordprocessingMLPackage insertFromHerePackage = WordprocessingMLPackage.load(new File(insertFromHerePath));
// get the XML of both documents
String xmlMain ...