User Guide
Application object 245
Example function Main() {
Var sInput;
Var sOutput;
with (Application) {
sInput = InputBox(VersionText, "What is your name?", "Alex");
sOutput = "I know you, your name is " + sInput + ".";
MessageBox (sOutput, VersionText, 0);
}
}
NewDocument
Syntax NewDocument(wbUseDefaultTemplate: WordBool);
Description Boolean. Creates a new document, optionally from the default template.
Example
function Main(){
with (Application){
NewDocument(true);
}
}
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
}
}
OpenFile
Syntax OpenFile(const wsFile: WideString): WordBool;
Description Boolean. Opens the passed file. Returns True if the file opens or is already open.
Passing an empty string to OpenFile displays the Open File dialog box, which
enables the user to select the files to open.