Window.GetPoint method (Word)
Returns the screen coordinates of the specified range or shape.
Syntax
expression. GetPoint
( _ScreenPixelsLeft_
, _ScreenPixelsTop_
, _ScreenPixelsWidth_
, _ScreenPixelsHeight_
, _obj_
)
expression Required. A variable that represents a Window object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ScreenPixelsLeft | Required | Long | The variable name to which you want Microsoft Word to return the value for the left edge of the object. |
ScreenPixelsTop | Required | Long | The variable name to which you want Word to return the value for the top edge of the object. |
ScreenPixelsWidth | Required | Long | The variable name to which you want Word to return the value for the width of the object. |
ScreenPixelsHeight | Required | Long | The variable name to which you want Word to return the value for the height of the object. |
obj | Required | Object | A Range or Shape object. |
Remarks
If the entire range or shape isn't visible on the screen, an error occurs.
Example
This example examines the current selection and returns its screen coordinates.
Dim pLeft As Long
Dim pTop As Long
Dim pWidth As Long
Dim pHeight As Long
ActiveWindow.GetPoint pLeft, pTop, pWidth, pHeight, _
Selection.Range
MsgBox "Left = " & pLeft & vbLf _
& "Top = " & pTop & vbLf _
& "Width = " & pWidth & vbLf _
& "Height = " & pHeight
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.