RangeFromPoint Method

Microsoft Office Web Components Object Model

Show All

RangeFromPoint Method

       

RangeFromPoint method as it applies to the ChartSpace  object.

Returns the most detailed object at the specified location in a chart workspace. For example, if you specify the x- and y-coordinates of a point, the corresponding ChPoint object is returned, even though a series also exists at those coordinates.

expression.RangeFromPoint(X, Y)

expression   Required. An expression that returns a ChartSpace object.

X  Required Long.

Y  Required Long.

RangeFromPoint method as it applies to the Window object.

Returns the Range object that is positioned at the specified pair of screen coordinates. If there isn't a range located at the specified coordinates, this method returns Nothing.

expression.RangeFromPoint(X, Y)

expression   Required. An expression that returns a Window object.

X  Required Long.

Y  Required Long.

Example

As it applies to the ChartSpace object.

This example changes the value of an HTML text box named "Textbox" when the mouse pointer passes over an object in ChartSpace1. The value of the text box reflects the type of object that the mouse pointer passes.

Sub ChartSpace1_MouseMove(ByVal Button, ByVal Shift, ByVal x, ByVal y)

    ' Set the value of Textbox to the type of object .
    Textbox.Value = TypeName(ChartSpace1.RangeFromPoint(x,y))
End Sub