Вы можете записать макрос, а затем открыть макрос IDE (Alt + F11) и поместить предварительно записанный макрос в цикл, как показано ниже:
Sub TemporaryMacro()
selection = DTE.ActiveDocument.Selection()
anchorPoint = selection.AnchorPoint.CreateEditPoint
selection.EndOfDocument(True)
endPoint = selection.BottomPoint.CreateEditPoint()
selection.MoveToPoint(anchorPoint)
Do While True
isEOF = DTE.ActiveDocument.Selection.TopPoint.CreateEditPoint().Line = endPoint.Line
If (isEOF) Then
Exit Do
End If
' Prerecorded macro
DTE.ActiveDocument.Selection.Text = " "
DTE.ActiveDocument.Selection.LineDown()
DTE.ActiveDocument.Selection.CharLeft()
' End of prerecorder macro
Loop
End Sub