Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Delete blank lines at end of document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
USAFA - 28 Feb 2005 20:51 GMT
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.  
Helmut Weber - 01 Mar 2005 09:30 GMT
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
USAFA - 01 Mar 2005 11:39 GMT
Helmut,
You've helped me once before & I thank you again for this info.  And yes, I
meant paragraphs.

Cheers!
USAFA

> Hi,
>
[quoted text clipped - 11 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.