I would like to replace word tags "{DOCPROPERTY XXXX \* MERGEFORMAT}" with information from arris during the creation of a report.
example:
var docTemplateData = Context.getFile ("Word Template.docm", Constants.LOCATION_SCRIPT);
var oOutput = Context.getOutputObject (getString ("REPORT_TITLE") + extension, docTemplateData);
oOutput.SetTitle (getString ("REPORT_TITLE"));
and here, replace my value XXXX with a value of an object.
For example :
{DOCPROPERTY Author \ * MERGEFORMAT}
{DOCPROPERTY Subject \ * MERGEFORMAT}
{DOCPROPERTY Title \ * MERGEFORMAT}
Do you have an idea ??
Yes, this is possible:
Context.setProperty("use-new-output", true);
oTemplateData = Context.getFile("Test.docx", Constants.LOCATION_SCRIPT);
g_oOutFile = Context.getOutputObject("Output file name", oTemplateData);
...
if (g_oOutFile.SetPositionToField("MergeFieldName", true)){
...
}
MergeFieldName is the name of the Word Mergefield...
BR Robert
thank you for your reply
But I have unfortunately not expressed my need, I would like to modify the properties of the document that can be found under a type tag {DOCPROPERTY XXXX \ * MERGEFORMAT}, and not add new fields in my templates.
For example :
{DOCPROPERTY Author \ * MERGEFORMAT}
{DOCPROPERTY Subject \ * MERGEFORMAT}
{DOCPROPERTY Title \ * MERGEFORMAT}