msdn上有一个调用ActiveXObject的例子:
var ExcelSheet;
ExcelApp = new ActiveXObject("Excel.Application");
ExcelSheet = new ActiveXObject("Excel.Sheet");但是找不到调用自己写的*.ocx的例子,不知道能否实现?那位高手能给个例子,谢谢。

解决方案 »

  1.   

    Description
    Enables and returns a reference to an Automation object.
    Syntax
    var newObject = new ActiveXObject(class)
    The class argument uses the syntax servername.typename and has these parts: Part Description 
    servername The name of the application providing the object. 
    typename The type or class of the object to create. 
    Res
    Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object.
    To create an Automation object, assign the new ActiveXObject to an object variable: var ExcelSheet;
    ExcelSheet = new ActiveXObject("Excel.Sheet");————————————————————————————————————————————
    Automation object 
    An object that is exposed to other applications or programming tools through Automation interfaces.
    --------------------------------------------------------------------------------
    所以ActiveX应该不行。
      

  2.   

    可以调用。http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/vccore/html/_core_upgrading_an_existing_activex_control_to_be_used_on_the_internet.asp
    在 Web 页上显示控件
    以下是一个关于在 Web 页上插入控件的对象标记和属性的示例。<OBJECT
    CLASSID="clsid:FC25B780-75BE-11CF-8B01-444553540000"
    CODEBASE="/ie/download/activex/iechart.ocx"
    ID=chart1
    WIDTH=400
    HEIGHT=200
    ALIGN=center
    HSPACE=0
    VSPACE=0
    >
    <PARAM NAME="BackColor" value="#ffffff">
    <PARAM NAME="ForeColor" value="#0000ff">
    <PARAM NAME="url" VALUE="/ie/controls/chart/mychart.txt">
    </OBJECT>
      

  3.   

    可以,可以在html中嵌入script调用,也可以通过实现IActiveScriptSite接口,进行调用
      

  4.   

    高手,我想知道本地如何调用,就是通过wscript,不嵌入html,不通过ie。能给个例子么,谢谢。
      

  5.   

    wscript我不知道,但按照你说的,IActiveScriptSite接口这个方法是可以的,你要不看看潘爱民的blog(CSDN)