
The following sections are a reference guide for using the WebBrowser control with Microsoft® Visual Basic®. This reference covers all the supported properties, methods, and events associated with the WebBrowser and InternetExplorer objects.
This section describes the WebBrowser and InternetExplorer objects.
The WebBrowser object adds browsing capabilities to your applications. Applications hosting this ActiveX Control will support browsing sites on the World Wide Web, as well as directories on the local computer and on network servers.
AddressBar ,Application, Busy, Container, Document, FullScreen, Height, Left, LocationName, LocationURL, MenuBar, Offline, Parent, ReadyState, RegisterAsBrowser, RegisterAsDropTarget, Resizable, Silent, StatusBar, StatusText, TheaterMode, ToolBar, Top, TopLevelContainer, Type, Visible, Width
ExecWB, GoBack, GoForward, GoHome, GoSearch, Navigate, Navigate2, Quit, Refresh, Refresh2, ShowBrowserBar, Stop
BeforeNavigate2, CommandStateChange, DocumentComplete, DownloadBegin, DownloadComplete, NavigateComplete2, NewWindow2, OnFullScreen, OnMenuBar, OnStatusBar, OnTheaterMode, OnToolBar, OnVisible, ProgressChange, StatusTextChange, TitleChange
The InternetExplorer object controls a remote instance of the Internet Explorer application through OLE Automation.
AddressBar, Application, Busy, Container, Document, FullName, FullScreen, Height, HWND, Left, LocationName, LocationURL, MenuBar, Name, Offline, Parent, Path, ReadyState, RegisterAsBrowser, RegisterAsDropTarget, Resizable, Silent, StatusBar, StatusText, TheaterMode, ToolBar, Top, TopLevelContainer, Type, Visible, Width
ClientToWindow, ExecWB, GetProperty, GoBack, GoForward, GoHome, GoSearch, Navigate, Navigate2, PutProperty, QueryStatusWB, Quit, Refresh, Refresh2, ShowBrowserBar, Stop
BeforeNavigate2, CommandStateChange, DocumentComplete, DownloadBegin, DownloadComplete, NavigateComplete2, NewWindow2, OnFullScreen, OnMenuBar, OnQuit, OnStatusBar, OnTheaterMode, OnToolBar, OnVisible, ProgressChange, PropertyChange, StatusTextChange, TitleChange
This section describes the properties associated with the WebBrowser control.
Returns or sets a value that determines whether the Internet Explorer application URL address bar is visible or hidden.
object.AddressBar
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
The WebBrowser object ignores the AddressBar property.
Returns the automation object supported by the application that contains the WebBrowser control, if the object is accessible; otherwise, this property returns the WebBrowser control's automation object.
object.Application
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Use this property with the Set and CreateObject commands or with the GetObject command to create and manipulate an instance of the Internet Explorer application as shown in the following early binding example.
Dim IE As SHDocVw.InternetExplorer Set IE = CreateObject("InternetExplorer.Application")
Returns a Boolean value indicating whether the WebBrowser control or Internet Explorer application is engaged in a navigation or downloading operation. If the control is busy, you can use the Stop method to cancel the navigation or download operation before it is completed.
object.Busy
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
The Busy property returns TRUE if a download or navigation operation is currently in progress, or FALSE otherwise.
Returns an object that evaluates to the container of the WebBrowser control, if any.
object.Container
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns the automation object of the active document, if any. This provides access to the contents of the HTML document through the object model. For more information, see the document object section in the Dynamic HTML reference.
object.Document
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns a string that evaluates to the fully qualified path of the executable file that contains the Internet Explorer application.
object.FullName
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns or sets a value indicating whether the Internet Explorer window is maximized.
object.FullScreen [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether Internet Explorer is maximized. If TRUE, the browser window is maximized; if FALSE, it is not. The default value is FALSE.
The WebBrowser object ignores the FullScreen property.
Returns or sets the vertical dimension, in pixels, of the frame window that contains the WebBrowser control.
object.Height [= height]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. height Optional. A long integer value that specifies the vertical dimension of the frame window, in pixels.
Returns the window handle to the Internet Explorer main window.
object.HWND
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns or sets the distance between the internal left edge of the WebBrowser control and the left edge of its container.
object.Left [= distance]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. distance Optional. A long integer expression that specifies the distance between the internal left edge of the WebBrowser control and the left edge of its container.
The Left property is measured in units depending on the coordinate system of its container. The values for this property change as the object is moved by the user or by code.
Returns a string that contains the name of the resource that the WebBrowser control is currently displaying. If the resource is an HTML page on the World Wide Web, the name is the title of that page. If the resource is a folder or file on the network or local computer, the name is the full path of the folder or file in the Universal Naming Convention (UNC) format.
object.LocationName
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns a string that contains the URL of the resource that the WebBrowser control or Internet Explorer application is currently displaying. If the resource is a folder or file on the network or local computer, the name is the full path of the folder or file in the Universal Naming Convention (UNC) format.
object.LocationURL
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns or sets a value that determines whether the Internet Explorer application menu bar is visible or hidden.
object.MenuBar [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether the menu bar is visible. If TRUE, the menu bar is visible; if FALSE, it is hidden. The default value is TRUE.
Setting this property to FALSE prevents the user from accessing the File, Edit, View, Go, Favorites, and Help menus. This can be used for limiting the functionality of an Internet Explorer application from a controlling application.
The WebBrowser object ignores the MenuBar property.
Returns a string that evaluates to the name of the Internet Explorer applicationthat is, "Microsoft Internet Explorer."
object.Name
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
This property is read-only.
Returns or sets a value indicating whether the WebBrowser control is currently operating in offline mode. In offline mode, the browser is forced to read HTML pages from the local cache rather than from the source document.
object.Offline [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether the WebBrowser control is in offline mode. If TRUE, the WebBrowser will read data about its current URL from its local cache; if FALSE, it will attempt to read the source document. The default value is FALSE.
Returns an object that evaluates to the form on which the WebBrowser control is located, or to the automation object supported by Internet Explorer.
object.Parent
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns a string that evaluates to the full path of the Internet Explorer application.
object.Path
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Retrieves the ready state of the object. This will be one of the READYSTATE values.
object.ReadyState
Part Description object Required. An object expression that evaluates to an object in the Applies To list.
Returns or sets a value indicating whether the WebBrowser control is registered as a top-level browser for target name resolution.
object.RegisterAsBrowser [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether Internet Explorer is registered as a top-level browser. If TRUE, the WebBrowser is registered as a top-level browser; if FALSE, it is not a top-level browser. The default value is FALSE.
Returns or sets a value indicating whether the WebBrowser control is registered as a drop target for navigation.
object.RegisterAsDropTarget [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether Internet Explorer is registered as a drop target for navigation. If TRUE, the WebBrowser is registered as a drop target; if FALSE, it is not a drop target. The default value is FALSE.
Sets or retrieves a value indicating whether the object can be resized.
object.Resizable [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that sets the object's resizable property. If this value is True, the object can be resized. If this value is False, the object cannot be resized. The default value is True.
The WebBrowser object ignores the Resizable property.
Returns or sets a value indicating whether any dialog boxes can be shown.
object.Silent [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether the WebBrowser can show any dialog boxes. If TRUE, dialog boxes will not be displayed; if FALSE, dialog boxes will be displayed. The default value is FALSE.
Returns or sets a value that determines whether the status bar is visible.
object.StatusBar [= value]
Part Description object Required. An object expression that evaluates to an InternetExplorer object. value Optional. A Boolean expression that determines whether the status bar is visible. If TRUE, the status bar is visible; if FALSE, it is hidden. The default is TRUE.
The WebBrowser object ignores the StatusBar property.
Returns or sets the text for the status bar.
object.StatusText [= value]
Part Description object Required. An object expression that evaluates to an InternetExplorer object. value Optional. A string that evaluates to the text for the status bar.
The WebBrowser object ignores the StatusText property.
Returns or sets a value indicating whether Internet Explorer is in theater or normal window mode. In theater mode, the Internet Explorer main window fills the entire screen and displays a toolbar with a minimal set of navigational buttons. A status bar is also provided in the upper right-hand corner of the screen. Channels, Search, History, and Favorites browser bars appear (if enabled) as an autohide pane on the left edge of the screen in theater mode.
object.TheaterMode [= value]
Part Description object Required. An object expression that evaluates to an object in the Applies To list. value Optional. A Boolean expression that determines whether Internet Explorer is in theater or normal window mode. If TRUE, the object is in theater mode; if FALSE, it is in normal mode. The default value is FALSE.
The WebBrowser object ignores the TheaterMode property.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.