Applies To:
  • CitectSCADA 5.20, 5.21

How do I use Microsoft Internet Explorer 5 as an ActiveX object in a Citect page? 

There are a few ways to do this.  One way is to create a new page in your project and open the page properties and add the following Cicode to the events on page entry -

    CreateControlObject("Microsoft Web Browser","Web Browser", 40, 130, 635, 450);
    _ObjectCallMethod(ObjectByName("Web Browser"),"Navigate2",URL,"","","","");

Look up the help for the above functions, as you may need to adjust the size of the window that opens, depending upon the resolution of the page created.  Once the page is open call the function -

    _ObjectCallMethod(ObjectByName("Web Browser"),"Navigate2",URL,"","","","")

Where URL is a String that specifies an address or directory or file to browse to (eg.  I have tested this with IE5 and found you can also open and edit MS Excel files if Excel is installed (eg. c:\temp\text.xls).

Other functions that may be useful are:

    STOP: _ObjectCallMethod(ObjectByName("Web Browser"),"Stop")
    REFRESH: _ObjectCallMethod(ObjectByName("Web Browser"),"Refresh")
    FORWARD: _ObjectCallMethod(ObjectByName("Web Browser"),"GoForward")
    BACK: _ObjectCallMethod(ObjectByName("Web Browser"),"GoBack")