Код: Выделить всё
Sub DeleteLine()
Dim DeleteLine As String
DeleteLine = InputBox("Введите слово для удаления строки", "Удаляем строки")
If DeleteLine = Empty Then Exit Sub
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
.ClearFormatting
.Text = DeleteLine
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
While .Execute
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Delete
Wend
End With
Application.ScreenUpdating = True
End Sub