ReplaceCurrentWord
function ReplaceCurrentWord(
sReplace: string = null,
sPart: "undefined" | before | after = null,
): boolean
Description
Replace the current word or part of the current word with the specified text
Parameters
- sReplace
string
null String to replace
- sPart
"undefined" | before | after
null Specifies the desired part of the current word
Returns
boolean
Try It
let oDocument = Api.GetDocument();
let oPara1 = oDocument.GetElement(0);
oPara1.AddText("The quick brown ");
let oRun = oPara1.AddText("cat");
oPara1.AddText(" jumps over the lazy dog");
oRun.MoveCursorToPos(1);
oDocument.ReplaceCurrentWord("fox");