Finds and replaces the text.
Name | Type | Default | Description |
oProperties | Object | The properties to find and replace. |
|
oProperties.searchString | string | Search string. |
|
oProperties.replaceString | string | Replacement string. |
|
oProperties.matchCase | string | true | Case sensitive or not. |
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", "SearchAndReplace.docx"); builder.CloseFile();