2 Star 0 Fork 0

Gitee 极速下载/VBAbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hongwenjun/vbabox
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
RotateMoveDuplicate.bas 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
Attribute VB_Name = "RotateMoveDuplicate"
Public Function move_shapes(x As Double, y As Double)
On Error GoTo ErrorHandler
API.BeginOpt
Dim sr As ShapeRange '// 使用 ShapeRange 可以多个物件一起操作
Set sr = ActiveSelectionRange '// 选择物件队列使用 ActiveSelectionRange
sr.Move x, y '// 默认单位是 英寸 所以移动太远了
ErrorHandler:
API.EndOpt
End Function
Public Function Duplicate_shapes(x As Double, y As Double)
On Error GoTo ErrorHandler
API.BeginOpt
Dim sr As ShapeRange
Dim sr_copy As ShapeRange
Set sr = ActiveSelectionRange
Set sr_copy = sr.Duplicate(x, y) '// Duplicate 是再制,如果前面有 = 赋值,就要加上 (x,y)
sr_copy.CreateSelection
ErrorHandler:
API.EndOpt
End Function
'// 批量旋转角度
Public Function Shapes_Rotate(angle As Double)
On Error GoTo ErrorHandler
API.BeginOpt
ActiveDocument.ReferencePoint = cdrCenter
Dim sr As ShapeRange
Set sr = ActiveSelectionRange
For Each s In sr
s.Rotate angle
Next
ErrorHandler:
API.EndOpt
End Function
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/VBAbox.git
git@gitee.com:mirrors/VBAbox.git
mirrors
VBAbox
VBAbox
main

搜索帮助

Cb406eda 1850385 E526c682 1850385