This is an object for embedding other applications into web pages on the Windows platform. The example shows the creation of an object that is managed by the Word application.
This is also used to create Dictionary objects by using the Scripting application to create a new Dictionary object.
This is totally non-portable and non-standard, but if your scripts are likely to be deployed in a Windows only environment, it may be useful.
Using this construct in client side scripting is subject to security restrictions. If a script in a web browser could just instantiate Word, then that implies that it has rights of access to the local file system. The normal IE security settings disallow that level of access.
// An example that opens a Word document and writes // text into it. var myActiveX = new ActiveXObject("Word.Document"); myActiveX.Application.Visible=true; myString="Some text to be written to the document"; // now write the text to the Word document myActiveX.application.selection.typeText(myString);