Removing Pages in a long document

R

reekop

I have a large document that I wish to remove particular
pages. i.e. in a 100 page document I wish to remove
specific pages 6-10, 50-55 etc. (kind of like the Page
Ranges idea in the Print option). I wish to delete the
page(s) and text in one action if possible.

Any suggestions apprecitated.
 
S

Suzanne S. Barnhill

The only way to delete pages is to select all the text on those pages and
delete it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

There is no such thing as a page in Word. The page is merely a transient
device created by a combination of formatting and the printer driver. If you
could delete pages 6-10, then the document would reformat and 50-55 would no
longer be in the same place. Also depending what elements are on the page,
the results could be curious to say the least.

The following macro will do what you ask, but I strongly urge you only to
use it on a copy of the document as the results will be unpredictable. If
the wheel comes off, Word has many layers of undo :)

Sub PageDelete()
sNumber = InputBox("Delete from which page", "Delete Pages", 1)
sRange = InputBox("Delete how many pages", "Delete Pages", 1)
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=sNumber
For a = 1 To sRange
ActiveDocument.Bookmarks("\page").Range.Delete
Next a
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
R

rekoop

-----Original Message-----
There is no such thing as a page in Word. The page is merely a transient
device created by a combination of formatting and the printer driver. If you
could delete pages 6-10, then the document would reformat and 50-55 would no
longer be in the same place. Also depending what elements are on the page,
the results could be curious to say the least.

The following macro will do what you ask, but I strongly urge you only to
use it on a copy of the document as the results will be unpredictable. If
the wheel comes off, Word has many layers of undo :)

Sub PageDelete()
sNumber = InputBox("Delete from which page", "Delete Pages", 1)
sRange = InputBox("Delete how many pages", "Delete Pages", 1)
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=sNumber
For a = 1 To sRange
ActiveDocument.Bookmarks("\page").Range.Delete
Next a
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Hello Again,
Inserted the macro and rec'd the following msg...
Run-time error 5904
Cannot edit Range

When I debug the ActiveDocument.Bookmarks line is
highlighted.

Thank-you (Again)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top