BeforeNavigate2 EventBeforeNavigate2 Event*
*Contents  *Index  *Topic Contents
*Previous Topic: Events
*Next Topic: CommandStateChange Event

BeforeNavigate2 Event

Description

Occurs when the WebBrowser control is about to navigate to a different URL, which may happen as a result of external automation, internal automation from a script, or the user clicking a link or typing in the address bar. The container has an opportunity to cancel the pending navigation.

Syntax

Private Sub object_BeforeNavigate2(ByVal pDisp As Object, ByVal URL As String,
ByVal Flags As Long, ByVal TargetFrameName As String, PostData As Variant,
ByVal Headers As String, Cancel As Boolean)

ValueDescription
objectRequired. An object expression that evaluates to an object in the Applies To list.
pDispAn object that evaluates to the top-level or frame WebBrowser object corresponding to the navigation.
URLA string expression that evaluates to the URL to which the browser is navigating.
FlagsReserved for future use.
TargetFrameNameA string expression that evaluates to the name of the frame in which the resource will be displayed, or NULL if no named frame is targeted for the resource.
PostDataData to send to the server if the HTTP POST transaction is being used.
HeadersA value that specifies the additional HTTP headers to send to the server (HTTP URLs only). The headers can specify things like the action required of the server, the type of data being passed to the server, or a status code.
CancelA Boolean value that the container can set to TRUE to cancel the navigation operation, or to FALSE to allow it to proceed.

Applies To

InternetExplorer, WebBrowser

See Also

Navigate, Navigate2, NavigateComplete2


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.