I'm trying to use the OpenTBS/TinyButStrong library to replace merge fields in a word document.
We can take a very basic word document like this:
Hello, My Name Is Bob, My Age Is <<BOBAGE>>
Which in word has the following code:
{MERGEFIELD BOBAGE\*MERGEFORMAT}
And my code would be basic:
$TBS = new \clsTinyButStrong();
$TBS->PlugIn(TBS_INSTALL,OPENTBS_PLUGIN);
$TBS->LoadTemplate($path,OPENTBS_ALREADY_UTF8);
$TBS->MergeField('BOBAGE','TEST');
$TBS->Show(OPENTBS_FILE,$tmpPath . 'test.docx');
When i open test.docx, the merge field isn't replaced!
It works if i use [bobage] which isn't actually a word merge field! That's not what i expected it to do, that's pretty useless.
Is there a way to replace the actual word merge fields?