求一段word中的VBA程序

要求隔一行删三行
2025-01-07 03:33:43
推荐回答(1个)
回答1:

Sub haifeistar()
Selection.HomeKey wdStory
Do While Selection.Range.End <> ActiveDocument.Content.End - 1
Selection.MoveDown
Selection.MoveDown wdLine, 3, True
Selection.Delete
Loop
End Sub

或者

Sub haifeistar()
Selection.HomeKey wdStory
Do
Selection.MoveDown
Selection.MoveDown wdLine, 3, True
Selection.Delete
Loop Until Selection.Range.End = ActiveDocument.Content.End - 1
End Sub