User Guide
219
Methods
BeginUpdate
procedure BeginUpdate()
Turns off screen updating for the active document. This is useful if your script needs to
make several changes to the active document at once — turning off screen updating
during the procedure might significantly speed up the process. To turn updating back
on, use
EndUpdate.
Use
BeginUpdate...EndUpdate with caution. If you fail to call EndUpdate after a call to
BeginUpdate, or if the script crashes before EndUpdate is called, the user will be unable
to see any changes made in the editor.
Clear
procedure Clear()
Clears all text from the active document.
Close
function Close(wbPromptToSave: WordBool): WordBool
Closes the active document. If
wbPromptToSave is True, the user is prompted to save
any changes. Returns True if the document was closed (that is, the user didn’t cancel
saving changes).
EndUpdate
procedure EndUpdate()
Turns on screen updating for the active document.
GetCaretPos
procedure GetCaretPos(var x, y: integer)
Returns the caret pos (x=column, y=line).
GetCurrentChar
function getCurrentChar(): OleVariant
Returns the current character.
GetNextChar
function GetNextChar(): OleVariant
Returns the next character. Note that this function (along with
GetPreviousChar) can
be slow when used in long loops.
GetPreviousChar
function GetPreviousChar(): OleVariant
Returns the previous character.