GetPoint 方法

       

返回指定区域或图形的屏幕坐标。

expression.GetPoint(ScreenPixelsLeft, ScreenPixelsTop, ScreenPixelsWidth, ScreenPixelsHeight, obj)

expression   必需。该表达式返回一个 Window 对象。

ScreenPixelsLeft   Long 类型,必需。需要 Microsoft Word 为对象的左边界值返回的变量名。

ScreenPixelsTop   Long 类型,必需。需要 Microsoft Word 为对象的顶部边界值返回的变量名。

ScreenPixelsWidth   Long 类型,必需。需要 Microsoft Word 为对象的宽度返回的变量名。

ScreenPixelsHeight   Long 类型,必需。需要 Microsoft Word 为对象的高度值返回的变量名。

obj   Object 类型,必需。RangeShape 对象。

说明

如果在屏幕上看不到整个区域或图形,则导致出错。

示例

本示例检查当前选定对象并返回其屏幕坐标。

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