IWebBrowserBox.OleObject

Syntax

OleObject: Variant;

Description

The OleObject property returns the web page loaded to the component as an OLE object.

Comments

Working with the obtained OLE object is executed by the methods Invoke, GetProperty (GetPropertyEx) and SetProperty (SetPropertyEx). These methods enable the user to work with properties and methods of the WebBrowser object, on which the WebBrowserBox component is based. It also supports properties and methods of the IWebBrowser2 interface used on working with instances of Internet Explorer browser. Description of WebBrowser/IWebBrowser2 is given in MSDN.

Example

WebBrowserBox1.OleObject.Invoke("GoBack", nil);

The result of this code execution is that the Back command is executed for the web page displayed in the WebBrawserBox1 component.

WebBrowserBox1.OleObject.Invoke("GoForward", nil);

The result of this code execution is that the Next command is executed for the web page displayed in the WebBrawserBox1 component.

WebBrowserBox1.OleObject.Invoke("Stop", nil);

The result of this code execution is that the Stop command is executed for the web page displayed in the WebBrawserBox1 component.

Array is a type of the "nil" variable for the examples given above.

URL:=WebBrowserBox1.OleObject.GetProperty("LocationURL") As string

After execution of this code, the URL variable (the String type) contains the URL of the page that is displayed in the WebBrowserBox1 component.

See also:

IWebBrowserBox