DocumentBuilder SearchAndReplace

Post Reply
Posts: 1
Joined: Wed Mar 25, 2020 9:28 am

DocumentBuilder SearchAndReplace

Post by goofy » Wed Mar 25, 2020 9:35 am

I'm using DocumentBuilder 4.4.1
I'm trying modify a existing docx document to modify some text
In this cas i want to remplace teh text "TOTO" by "TITI"
So this my code :

Code: Select all


var oDocument = Api.GetDocument();

builder.SaveFile("docx", "./TESTFILES/test.docx");   // save the resulting text document as a file in the .docx format with a new 'example.docx' name
There is a error :
execute_run_code: oDocument.SearchAndReplace(oDocument,"TOTO","TITI");
execute_run: Uncaught TypeError: oDocument.SearchAndReplace is not a function
in ... andreplace i saw :
SearchAndReplace(oProperties, oProperties.searchString, oProperties.replaceString, [oProperties.matchCase])

the function exists but what is oPropertie ?
Can yoi help me ?

Post Reply