You want to copy data from the open document to the created document, but the path to the open document is not fixed, so you need to pass in the parameter
The code example is as follows:
var dataUrl = Argument["dataUrl"];
builder.OpenFile(dataUrl);
var oDocument = Api.GetDocument();
GlobalVariable["CommentsReport"] = oDocument.GetElement(0).GetText();
builder.CloseFile();
builder.CreateFile("docx");
var oCommentsReport = GlobalVariable["CommentsReport"];
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Data from DOC file: " + oCommentsReport);
builder.SaveFile("docx", "GetCommentsReport.docx");
builder.CloseFile();
Called through the docbuilder interface
{
"async": false,
"url": "https://example.com/getCommentsReport.docbuilder",
"argument": {
"dataUrl": "https://example.com/dataFormData.docx"
}
}
After running, an error is reported:
{
"key": "bld_f8e610a8d71f26e5",
"urls": {},
"end": true
}
Help with that. Thank you so much