IHTMLEventObj Object

Microsoft FrontPage Visual Basic

IHTMLEventObj Object

Multiple objects IHTMLEventObj
IHTMLElement

Represents an user action that occurs because on a document, window, or element within a document.

Using the IHTMLEventObj object

Use the event property of the FPHTMLWindow2 object to return an IHTMLEventObj object.

The following example creates an IHTMLEventObj object within the onclick event for the active document window which causes Microsoft FrontPage to display the number of times the mouse button has been clicked when a user clicks on the document.

    Private WithEvents objDoc As FPHTMLDocument
Public objWindow As FPHTMLWindow2

Private Sub Class_Initialize()

    Set objWindow = ActiveDocument.parentWindow
    Set objDoc = ActiveDocument

End Sub

Private Function objDoc_onclick() As Boolean

    Dim objEvent As IHTMLEventObj
    
    Set objEvent = objWindow.event
    
    MsgBox objEvent.Button
    
End Function
  

Place the above code in a class module named "Class1." Then place the following code in a regular code module and run it to activate the class module and the resulting events.

    Dim objFPEvent As Class1

Sub startevent()

    Set objFPEvent = New Class1

End Sub