User Guide
218 Chapter 14 Scripting the Visual Tools Object Model
NextDoc
Syntax NextDoc();
Description Moves to the next document in the Document tab. If the last document is showing,
wraps to the first.
Example
function Main() {
Var sMessage;
sMessage = "Hello world!";
with (Application) {
NewDocument(false);
NextDoc();
ActiveDocument.InsertText(sMessage); // Moving to the
newly-created document
}
}
PreviousDoc
Syntax PreviousDoc();
Description Moves to the previous document in the Document tab. If the first document is
showing, wraps to the last.
Example
function Main(){
with (Application){
// Create a new blank document
NewDocument(false);
// Move back to previous file
PreviousDoc();
}
}
Quit
Syntax Quit();
Description This method attempts to exit from or quit the program. It prompts the user to save
any unsaved documents prior to quitting.
Example
function Main(){
var MB_YESNO = 4;
var IDYES = 6;
with (Application){
if (MessageBox(’Exit HomeSite?’, ’Confirmation Message’,
MB_YESNO) == 6){
Quit();
}