onmousemove Event

Microsoft FrontPage Visual Basic

Show All Show All

onmousemove Event

Occurs when the user moves the mouse pointer over an element when a page is displayed in Design view in Microsoft FrontPage.

expression.onmousemove

expression    Required. An expression that returns one of the objects in the Applies To list, which has been declared using the WithEvents keyword in a class module.

Example

The following example follows the mouse pointer and selects the element over which the mouse pointer is positioned. This example must be placed in a class module, and it assumes that you have declared in the General Declarations section of a class module an FPHTMLDocument object variable called "objDoc" using the WithEvents keyword.

    Private Sub objDoc_onmousemove()
    Dim objEvent As IHTMLEventObj
    Dim objRange As IHTMLTxtRange
    Dim objElement As IHTMLElement
    
    Set objEvent = objDoc.parentWindow.event
    Set objElement = objEvent.srcElement
    Set objRange = ActiveDocument.body.createTextRange
    
    objRange.moveToElementText objElement
    objRange.Select
End Sub