my problem is that I have to run this macro in microsoft office word, which inserts a rectangle at the beginning and at the end of the page Now, the macro is registered with word and is as follows.
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
I tried to run a For Each like the following:
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
My goal is to repeat the recorded macro for each page of the document. I ask you for help to create this macro because it would save me a lifetime of time thanks.
thank you all
PS: I'm not a native English speaker if you do not understand something ask me