4

ActiveXObject() constructor support different types of parameters as follows:

new ActiveXObject("Msxml2.DOMDocument"); 
new ActiveXObject("Msxml2.XSLTemplate"); 
new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
new ActiveXObject("Msxml2.DOMDocument.6.0"); 
new ActiveXObject("Microsoft.XMLHTTP"); 
new ActiveXObject("Microsoft.XMLDOM"); 
new ActiveXObject("Excel.Application");
new ActiveXObject("Word.Application");
new ActiveXObject("Excel.Sheet");

Where would I find these parameters(activexobject constructor)?

from this link, I found some information as follows

new ActiveXObject(class[, servername]);

class uses the syntax library.object where library is the name of the application (e.g., Word, Excel) or library containing the object, and object is the type or class of the object to create. servername (an optional argument) specifies the name of the server on which the object resides.

Premraj
  • 72,055
  • 26
  • 237
  • 180

3 Answers3

6

ActiveX objects are binary extensions to Internet Explorer that (generally) add features that would otherwise not be supported by the browser.

When you install an ActiveX control, it modifies the system's Registry to register various interfaces and entry points so that the control is properly launched when a webpage asks for it.

ActiveX controls are generally created to extend the browser in specific ways; that is, they're designed to solve problems that may not be useful for learning JavaScript. Microsoft doesn't document the internal structure of many ActiveX controls, but you may be able to find information by searching the MSDN library for the name of the object you're interested in.

For example, here are the results of a search for Msxml2.DOMDocument.

As you may notice, this list isn't terribly useful.

You may find better luck searching for tutorials that teach web concepts by focusing on the feature you're interested in, such as XML.

(Also, you should be aware that ActiveX controls are supported only by Internet Explorer...and that IE is soon to be replaced by the Microsoft Edge browser that doesn't not support ActiveX controls. Thus, it might be better to focus on cross-browser solutions rather than proprietary ones.)

Hope this helps...

-- Lance

Lance Leonard
  • 3,285
  • 3
  • 16
  • 15
  • ActiveX objects are not (necesseraly) extensions to Internet Explorer; they are extensions to Windows. (Excel applications are extensions to the browser?) They can be used by any ActiveX supporting language (.Net languages, Python, Delphi, VBA/VB6), and can be created in any Javascript environment with Microsoft extensions (Internet Explorer, Windows Script Host). It is true, however, that some ActiveX controls are registered specifically for use in the Internet Explorer environment, and will probably crash when used outside it. – Zev Spitz Jul 14 '16 at 06:05
  • Relevant link https://msdn.microsoft.com/en-us/library/windows/desktop/ms221401%28v=vs.85%29.aspx – Zev Spitz Jul 14 '16 at 06:57
3

The ActiveXObject can accept any file type registered from the HKEY_CLASSES_ROOT Registry Key wich are essentially Program Ids, Class IDs and Interface keys. You can even add your own extensions.

For further information you can check the ActiveXObject MSDN Documentation and HKEY_CLASSES_ROOT Key documentation.

Ruslan López
  • 4,433
  • 2
  • 26
  • 37
1

You can use Nirsoft's ActiveX Helper which shows a list of registered ActiveX components on your system. Anything with a value in the ProgID column can be passed into new ActiveXObject (with or without the version number):

var wdApp = new ActiveXObject('Word.Application.14');
var wdApp2 = new ActiveXObject('Word.Application');
Zev Spitz
  • 13,950
  • 6
  • 64
  • 136