WPS 加载项开发 > 文字 API 参考 > Window > 方法 > Window.GetPoint 方法
返回指定区域或图形的屏幕坐标。

语法

表达式.GetPoint(ScreenPixelsLeft, ScreenPixelsTop, ScreenPixelsWidth, ScreenPixelsHeight, obj)

表达式   必选。一个代表 Window 对象的变量。

参数

名称 必选/可选 数据类型 说明
ScreenPixelsLeft 必选 Long 需要 WPS 为对象的左边界值返回的变量名。
ScreenPixelsTop 必选 Long 需要 WPS 为对象的顶部边界值返回的变量名。
ScreenPixelsWidth 必选 Long 需要 WPS 为对象的宽度返回的变量名。
ScreenPixelsHeight 必选 Long 需要 WPS 为对象的高度值返回的变量名。
obj 必选 Object RangeShape 对象。

说明

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

示例

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

示例代码
let pLeft=0.1
let pTop=0.1
let pWidth=0.1
let pHeight=0.1
ActiveWindow.GetPoint(pLeft, pTop, pWidth, pHeight, Selection.Range)
MsgBox("Left = " + pLeft + "\n" +
        "Top = " + pTop + "\n" +
        "Width = " + pWidth + "\n" +
        "Height = " + pHeight)


请参阅