The ActiveXObject Object enables and returns a reference to an automation object. This object is used only to instantiate automation objects and has no members. An example is as follows:
To create an automation object, assign the new ActiveXObject to an object variable:
Syntax
var Obj = new ActiveXObject("Scripting.FileSystemObject");
The FileSystemObject object provides access to the computer's file system. The properties and methods of the FileSystemObject are displayed in the table shown below:
Properties/Methods | Description |
BuildPath() | Appends information to a file path |
CopyFile() | Copies a file from one location to another |
CopyFolder() | Copies a folder from one location to another |
CreateFolder() | Creates a new folder object |
CreateTextfile() | Creates a new text file object |
DeleteFile() | Removes a file |
DeleteFolder() | Removes a folder object |
DriveExists() | Determines whether a drive exists |
Drives | Returns a Drives collection, containing all the available drive objects |
FileExists() | Determines whether a file exists |
FolderExists() | Determines whether a folder exists |
GetAbsolutePathName() | Returns the absolute pathname for a file |
GetBaseName() | Gets the base name of the last component |
GetDrive() | Gets the drive letter for a file |
GetDriveName() | Gets the drive name on which a file resides |
ExtensionName() | Returns the extension for a file |
GetFile() | Gets the file object |
GetFileName() | Gets the name of a file |
GetFolder() | Gets the folder name that contains a file |
GetParentFolderName() | Gets the parent folder's name |
GetSpecialFolder() | Gets the folder names for special folders |
GetTempName() | Creates a randomly generated temporary file |
MoveFile() | Moves a file from one location to another |
MoveFolder() | Moves a folder and its contents from one location to another |
OpentextFile() | Opens a text file stream to a file |
The ActiveXObject requires wsoffice.dll to be installed and also loaded in the script to function as designed. Therefore, to use this feature, developers need to ensure that the following code is included in the script immediately before the new ActiveXObject variable is created.
load("wsoffice.dll");
Options
ActiveX calls are not made through a WS command but instead are done through a set of custom functions. Therefore there are no options.