Delete blank lines at end of document

U

USAFA

I am trying to set up a macro that goes to the end of a document and deletes
the last 5 lines of the document (including a page break). The documents
vary in size so this macro needs to perform this function regardless of the
document size. I'm just learning how to write code, so I'd appreciate help
with this.
 
H

Helmut Weber

Hi,

in case you are talking of paragraphs,
not of lines
whether they are empty or not:

Dim l As Long
For l = 1 To 5
ActiveDocument.Paragraphs.Last.Range.Delete
Next

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
U

USAFA

Helmut,
You've helped me once before & I thank you again for this info. And yes, I
meant paragraphs.

Cheers!
USAFA
 
Top