CanUndo (WordBool, read-only)
Returns True if changes can be undone.
CanRedo (WordBool, read-only)
Returns True if changes can be re-done.
Filename (OleString, read-only)
Returns the filename of the active document.
Lines[Index: integer] (OleString)
Gets/sets the text of the line at the passed index.
Note: Iterating through a document using the Lines property may be slow, especially for large documents. It is recommend that you only use
Lines to evaluate single lines of text. If you must use Lines to update many lines, you can boost performance by wrapping the update in a
BeginUpdate..EndUpdate block.
LineCount (integer, read-only
Returns the number of lines in the active document.
Modified (WordBool, read-only)
Returns True if the document has been changed since it was last saved.
ReadOnly (WordBool, read-only)
Returns True if the active document is read-only.
SelStart (integer)
Gets/sets the start of the current selection.
SelLength (integer)
Gets/sets the length of the current selection
SelText (OleString)
Gets/sets the text in the current selection.
TabIndex
Gets/sets the tab index of the document tab.
Text (OleString)
Gets/sets the complete document text.
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 may significantly speed things up.
To turn updating back on, use EndUpdate.
Important: Use BeginUpdate...EndUpdate with caution. If you fail to call EndUpdate after a call to BeginUpdate, or if you script
crashes before EndUpdate is called, the user will be unable to see any changes made in the editor.
EndUpdate
procedure EndUpdate;
Turns on screen updating for the active document.
Clear
procedure Clear;
Clears all text form 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 (ie: the user didn't cancel saving changes).
GetCaretPos
procedure GetCaretPos(var x, y: integer);
Returns the caret pos (x=column, y=line).
GetNextChar
function GetNextChar: OleVariant;
Returns the next character. Note that this function (along with GetPreviousChar) can be
slow when used in long loops.
GotoNextStartTag
function GotoNextStartTag(wbSelect: WordBool): WordBool;
Moves the the next starting tag, selecting it if wbSelect is True. Returns False if
no tag found.
GotoPreviousStartTag
function GotoPreviousStartTag(wbSelect: WordBool): WordBool;
Moves the the previous starting tag, selecting it if wbSelect is True. Returns False if
no tag found.
GotoNextEndTag
function GotoNextEndTag(wbSelect: WordBool): WordBool;
Moves the the next end tag, selecting it if wbSelect is True. Returns False if
no tag found.
GetPreviousChar
function GetPreviousChar: OleVariant;
Returns the previous character.
GotoPreviousEndTag
function GotoPreviousEndTag(wbSelect: WordBool): WordBool;
Moves the the previous end tag, selecting it if wbSelect is True. Returns False if
no tag found.
Indent
procedure Indent;
Indents the current selection.
InsertTag
procedure InsertTag(sStartTag, sEndTag: OleVariant; wbOverwriteSelection: WordBool);
Inserts the passed tag pair at the current cursor position, overwriting the selection if
wbOverwriteSelection is True. The cursor will be positioned between the start and end tags after this operation,
and if wbOverwriteSelection is False, the current selection will be surrounded by the tags.
InsertText
procedure InsertText(InsertStr: OleVariant; wbOverwriteSelection: WordBool);
Inserts the passed string at the current cursor position, overwriting the selection if
wbOverwriteSelection is True.
Print
procedure Print(wbNoPrompt: WordBool);
Prints the active document. Prompts the user for print settings unless wbNoPrompt is True.
ReplaceAll
function ReplaceAll(strSearch, strReplace: OleVariant; bMatchCase: WordBool): Integer;
Replaces all occurences of strSearch with strReplace, matching case if bMatchCase is True. Returns the number
of replacments made.
Redo
procedure Redo;
Peforms a single redo operation.
Reload
procedure Reload(wbPromptToSave: WordBool);
Reloads the active document, prompting to save changes if wbPromptToSave is True.
Save
function Save: WordBool;
Saves changes to the active document, returning True if successful.
SaveAs
function SaveAs(wsFileName: widestring): WordBool;
Saves changes to the active document to the file specified in the wsFileName parameter, returning True if successful. If wsFileName is empty, the standard "Save As" dialog will be displayed to the user. Note that existing files will be overwritten by this function, so use with caution!
SelectAll
procedure SelectAll;
Selects all the text in the active document,
SetCaretPos
procedure SetCaretPos(x, y: Integer);
Sets the current column/line.
SelectLine
procedure SelectLine(Index: Integer);
Highlights the passed line.
SelectCurrentLine
procedure SelectCurrentLine;
Highlights the current line.
Undo
procedure Undo;
Peforms a single undo operation.
Unindent
procedure Unindent;
Un-indents the current selection.
Use these methods to position the cursor. If wbSelect is True, then the current selection will be extended to the new cursor position.
procedure CursorLeft(wbSelect: WordBool);
procedure CursorRight(wbSelect: WordBool);
procedure CursorWordLeft(wbSelect: WordBool);
procedure CursorWordRight(wbSelect: WordBool);
procedure CursorDown(wbSelect: WordBool);
procedure CursorUp(wbSelect: WordBool);
procedure CursorPageDown(wbSelect: WordBool);
procedure CursorPageUp(wbSelect: WordBool);
procedure CursorDocStart(wbSelect: WordBool);
procedure CursorDocEnd(wbSelect: WordBool);
procedure CursorLineStart(wbSelect: WordBool);
procedure CursorLineEnd(wbSelect: WordBool);