Application Object
217
Example
function Main() {
Var sInput;
Var sOutput;
with (Application) {
sInput = InputBox(VersionText, "What is your name?", "Alex");
sOutput = "I know you, your name is " + ".";
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);
}
}
OpenFile
Syntax
OpenFile(const wsFile: WideString): WordBool;
Description
Boolean. Opens the passed file. Returns if the file opens or is already open. Passing
an empty string to
OpenFile
displaysthe Open File dialog box, which enables the
user to select the files to open.
When using this method in JScript, you must escape backslashes inside a string. For
example, in
Application.OpenFile("C:\\Documents\\MyFile.htm")
; each
backslash is preceded by an additional backlash.
Example
function Main() {
Var sFile;
Var bResult;
sFile = "C:\\Temp\myDoc.txt"
with (Application) {
If(OpenFile(sFile))
MessageBox("File opened successfuly.", VersionText);
Else
MessageBox("File does not exist or already open.", VersionText);
}
}
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...