Word中删除含有"-->"的行时 ,工具-〉宏-〉Visual Basic编辑器-〉双击The Document,输入以下代码:
Sub op1()
Dim a As Paragraph
For Each a In ActiveDocument.Paragraphs
If InStr(a, "-->") Then
a.Range.Delete
End If
Next
End Sub
使用变量:
Sub op1()
Dim a As Paragraph, n As Integer
n = 1
For Each a In ActiveDocument.Paragraphs
If InStr(a, n) Then
a.Range.Delete
n = n + 1
End If
Next
End Sub
然后运行,就可以了
使用word删除指定行
最新推荐文章于 2021-12-05 14:02:53 发布