OleObject: Variant;
The OleObject property returns the web page loaded to the component as an OLE object.
Working with the obtained OLE object is performed by the methods Invoke, GetProperty (GetPropertyEx) and SetProperty (SetPropertyEx). These methods allow 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.
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 (array) is a type of "nil" variable for the examples given above.
URL:=WebBrowserBox1.OleObject.GetProperty("LocationURL") As string
After execution of this code, the URL variable (String type) contains the address of the page that is displayed in the WebBrowserBox1 component.
See also: