DocumentBuilder version: 4.4.1
Installation method: docbuilder.exe
OS: Windows 7 x64
I just copied this code from official api documentation (ONLYOFFICE Api Documentation - SearchAndReplace), put it in a .docbuilder script-file and… it doesn’t work.
builder.CreateFile(“docx”);
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText(“This is the first sample text. The serial number of this sample text was replaced here.”);
oDocument.SearchAndReplace({“searchString”: “first”, “replaceString”: “second”});
builder.SaveFile(“docx”,“c:\test.docx”);
builder.CloseFile();
Error is Uncaught TypeError: oDocument.SearchAndReplace is not a function (WHAT?)
What is that? And, of course, script doesn’t return any file.