elementFromPoint Method

Microsoft FrontPage Visual Basic

elementFromPoint Method

Returns the IHTMLElement object that corresponds to the specified page coordinates.

expression.elementFromPoint(x, y)

expression    Required. An expression that returns one of the objects in the Applies To list.

x    Required. A Long that represents a specified point on the horizontal axis from the left edge of the page.

y    Required. A Long that represents a specified point on the vertical axis from the top edge of the page.

Remarks

The coordinates correspond to page coordinates (0,0 is the top-left corner of the page). For the elementFromPoint method to exhibit the expected behavior, the object or element located at position (x, y) must support and respond to mouse events.

Example

The following example sets the active element using the elementFromPoint method.

    Dim objElement As IHTMLElement

Set objElement = ActiveDocument.elementFromPoint( _
    ActiveDocument.activeElement.offsetTop, _
    ActiveDocument.activeElement.offsetWidth)