Window.RangeFromPoint Method
Word Developer Reference |
Returns the Range or Shape object that is located at the point specified by the screen position coordinate pair.
Syntax
expression.RangeFromPoint(x, y)
expression Required. A variable that represents a Window object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
x | Required | Long | The horizontal distance (in pixels) from the left edge of the screen to the point. |
y | Required | Long | The vertical distance (in pixels) from the top of the screen to the point. |
Return Value
Object
Remarks
If no range or shape is located at the coordinate pair specified, the method returns Nothing.
Example
This example creates a new document and adds a five-point star. It then obtains the screen location of the shape and calculates where the center of the shape is. Using these coordinates, the example uses the RangeFromPoint method to return a reference to the shape and change its fill color.
Visual Basic for Applications |
---|
|
See Also