Hi, everbody
Could you pls tell me how i can write a macro to remove the lines that are just a blank line with no word or character around in a large document deleting blank lines? - AutoIt Forums:: In general theres 4 extra returns between each line of text. help me figure out a way to just remove any lines in a file that has no text in it? http://www.autoitscript.com/forum/index.php?showtopic=14071HOME |
thanks
Hello, I assume you mean trim paragraph breaks. Depends how many consecutive breaks you have. If it's always 1, the first should fire, if multiple, you'll probably want the second variety:
Sub MightWork() ThisDocument.Content.Find.Execute "^p^p", , , , _ , , True, wdFindContinue, , "^p", wdReplaceAll End Sub
Sub AlwaysWorks() Dim p As Paragraph For Each p In ThisDocument.Paragraphs If Len(p.Range) = 1 Then p.Range.Delete Next p End Sub
Hope this helps.
:)
Hello NateO
Very thanks and appreciate for your help .
it worked fine .
Sincerely yours
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|