February 26, 2000|
Tips: February 2000
Yehuda Shiran, Ph.D.
ActiveXObject()constructor function creates an instance of an OLE Automation (ActiveX) object. Once an object is created, you refer to it in code using the object variable you defined. If an instance of the ActiveX object is already running,
ActiveXObject()may start a new instance when it creates an object of the required type. The following code segment lets the user open a Word document directly:
var pause = 0; var wdDialogFileOpen = 80; var wdApp = new ActiveXObject("Word.Application"); var dialog = wdApp.Dialogs(wdDialogFileOpen); var button = dialog.Show(pause);
The preceding code segment references the
Word.Application object, and its methods are used later. Notice the hierarchical structure, where one method or property is actually an object that has its own methods and properties.