Is it possible to add customAttributes while adding content instead of using the customizeWordContent function after adding content?
Something like:
$docx->addText($text, ['customAttributes' => ['id' => 'myCustomId']]);
Is it possible to add customAttributes while adding content instead of using the customizeWordContent function after adding content?
Something like:
$docx->addText($text, ['customAttributes' => ['id' => 'myCustomId']]);
Hello,
There's no way to add custom attributes using methods such as addText or addTable. Please note that each internal OOXML attribute may have its own scope, options and others. And adding not valid OOXML attributes may generate a corrupted document that MS Word can't open.
The only way would be using DOCXPath or DOCXCustomizer.
Regards.
Thank you.
In addition, although it seems possible to add not valid OOXML attributes with customizeWordContent(), after editing and saving in MS Word these attributes are removed so that they can no longer be used when reading the document. I'm going to use a different approach.