30 lines
1021 B
JavaScript
30 lines
1021 B
JavaScript
const wps = {
|
|
app: wps.WpsApplication(),
|
|
replace: () => {
|
|
Selection.SetRange(16, 16);
|
|
Selection.Find.Wrap = wdFindContinue;
|
|
(obj => {
|
|
obj.Text = "1";
|
|
obj.Forward = true;
|
|
obj.Wrap = wdFindContinue;
|
|
obj.MatchCase = false;
|
|
obj.MatchByte = true;
|
|
obj.MatchWildcards = false;
|
|
obj.MatchWholeWord = false;
|
|
obj.MatchFuzzy = false;
|
|
obj.Replacement.Text = "2";
|
|
})(Selection.Find);
|
|
(obj => {
|
|
obj.Style = "";
|
|
obj.Highlight = wdUndefined;
|
|
(obj => {
|
|
obj.Style = "";
|
|
obj.Highlight = wdUndefined;
|
|
})(obj.Replacement);
|
|
})(Selection.Find);
|
|
Selection.Find.Execute(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, wdReplaceAll, undefined, undefined, undefined, undefined);
|
|
Selection.Find.Replacement.Text = "2";
|
|
}
|
|
|
|
}
|