【发布时间】:2018-01-20 17:52:19
【问题描述】:
我的问题是我必须在 microsoft office word 中运行这个宏,它会在页面的开头和结尾插入一个矩形 现在,宏是用word注册的,如下。
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveDocument.Shapes.AddShape(msoShapeRectangle, 0#, -23.65, 634.05, _
45.15).Select
Selection.ShapeRange.ScaleHeight 1.14, msoFalse, msoScaleFromTopLeft
ActiveWindow.ActivePane.VerticalPercentScrolled = 51
ActiveDocument.Shapes.AddShape(msoShapeRectangle, 0#, 812.4, 623.3, _
92.45).Select
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
我尝试运行 For Each,如下所示:
Dim pages As Page
For Each pages in ActiveDocument
'here I have pasted the contents of macro1 except the first and last line'
Next Page
我的目标是为文档的每一页重复录制的宏。 我请你帮忙创建这个宏,因为它可以节省我一生的时间,谢谢。
谢谢大家
PS:我不是以英语为母语的,如果有不懂的可以问我
【问题讨论】: