InternetExplorer object

The InternetExplorer object allows you to work with an Internet Explorer application.

Creating the application

Use the new keyword to create a new instance of Internet Explorer.

{Create a new instance of Internet Explorer.}
IExplorer = new SHDocVw.InternetExplorer();

When using Distributed COM (DCOM), create a new instance of Internet Explorer with the COM_CreateObject() function. In the following example, an instance of Internet Explorer is created on the computer “SystemServer”.

{Create a new instance of Internet Explorer.}
IExplorer = COM_CreateObject("SHDocVw.InternetExplorer", "SystemServer");

Showing and hiding the application

The Visible property allows you to show or hide the application. Setting the Visible property to true shows the application.

{Show the application.}
IExplorer.Visible = true;

Setting the Visible property to false hides the application.

{Hide the application.}
IExplorer.Visible = false;

The new keyword and the COM_CreateObject function return a hidden instance of an application. Use the Visible property to show a hidden application.


Loading a web page

Use the Navigate method to load a web page in Internet Explorer. You can load a web page with the Navigate method by specifying the URL.

{Use a URL to load a web page.}
IExplorer.Navigate("msdn.microsoft.com");

You can also load a file with the Navigate method by specifying the full pathname of the file.

{Use the full pathname to load a local file.}
IExplorer.Navigate("C:\RESM\RESM.XML");

Refreshing a web page

To refresh a web page, call the Refresh method.

{Refresh the web page.}
IExplorer.Refresh();

Stopping a web page from loading

To stop a web page from loading, use the Stop method.

{Stop loading a web page.}
IExplorer.Stop();

Hiding and showing dialog boxes

The Silent property allows you to hide and show dialog boxes in Internet Explorer. Setting the Silent property to true hides the dialog boxes.

{Hide the dialog boxes.}
IExplorer.Silent = true;

Setting the Silent property to false shows the dialog boxes. This is the default setting.

{Show the dialog boxes.}
IExplorer.Silent = false;

Hiding dialog boxes prevents the user from seeing warning messages and other prompts displayed by an application. Your code still must handle the errors or other exceptional conditions that caused Internet Explorer to display dialog boxes.


Closing an application

After you have finished using the application, you can close it with the Quit method.

{Close the application.}
IExplorer.Quit();


Documentation Feedback