Skip to content

BeforeNavigate2 Event

Description

Fires before a navigation occurs in the given object (on either a window or frameset element).

Syntax

Public Event BeforeNavigate2( _
    ByVal pDisp As Object, _
    ByRef URL As Variant, _
    ByRef Flags As Variant, _
    ByRef TargetFrameName As Variant, _
    ByRef PostData As Variant, _
    ByRef Headers As Variant, _
    ByRef Cancel As Boolean _
)

Parameters

  • pDisp: Object that evaluates to the top-level or frame WebBrowser object corresponding to the navigation.
  • URL: String expression that evaluates to the URL to which the browser is navigating.
  • Flags: Reserved for future use.
  • TargetFrameName: 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.
  • PostData: Data to send to the server if the HTTP POST transaction is being used.
  • Headers: Value that specifies the additional HTTP headers to send to the server (HTTP URLs only). The headers can specify such things as the action required of the server, the type of data being passed to the server, or a status code.
  • Cancel: Boolean value that the container can set to True to cancel the navigation operation, or to False to allow it to proceed.

Example

Navigating to a different URL could 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.

See Also

WebBrowser Control


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.