Share via

BeforeNavigate Event

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


  Private Sub object_BeforeNavigate( _
  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)


  • object
    Object expression that resolves to the objects in the Applies To list.
  • 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. Set to zero.
  • 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.


This event is obsolete. Use the BeforeNavigate2 event instead.

Applies To

InternetExplorer, WebBrowser