Quote:
Originally Posted by macropod
You don't need an OR test for what you've described; you need a LIKE test:
Code:
Sub DeleteLinesStartWith()
Dim i As Long
With ActiveDocument
For i = .Paragraphs.Count To 1 Step -1
With .Paragraphs(i).Range
If LCase(Trim(.Words.First.Text)) Like "[!.•]" Then .Delete
End With
Next i
End With
End Sub
|
I tried your code, and it doesn't work on empty lines start with "letter." like "A." although I have changed it to Like "[.1.2.3.4.A.B.C.D.©.!.•]. I changed it because I want to keep the original real empty lines--without anything in the front.
And also, I want to delete empty lines start with letters, like "B". In that case then how could VBA tell the difference between "A." and "A" if you use Like?