在页面上移动控件
下面的示例演示如何通过 Microsoft Forms 2.0 Controls 集合使用 Move 方法来移动窗体上的所有控件。 用户单击 CommandButton 以移动控件。
若要使用本示例,请将此示例代码复制到窗体的“脚本编辑器”中。 确保该窗体包含一个名为“CommandButton1”的 CommandButton 和几个其他控件。
Sub CommandButton1_Click()
Set Controls = Item.GetInspector.ModifiedFormPages("P.2").Controls
'Move each control on the form right 25 points and up 25 points.
Controls.Move 25, -25
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。