Deletion of Page in Document

D

D. Reese

Is it possible to delete an entire page in a lengthy Word
document without highlighting text?
 
G

Greg Maxey

D,

You can run the following macro which deletes text appearing as the page at
the insertion point:

Sub DeletePage()

Selection.GoTo What:=wdGoToBookmark, Name:="\page"
Selection.Delete
End Sub

Remember, Word does not create a "page" as separate little packages like a
PowerPoint slide. Unwanted layout may result in Word regardless how you
delete text.
 
J

Jezebel

To delete page X from Doc --

Dim pStart as long
Dim pEnd as long

With Doc
pStart = .GoTo(What:=wdGoToPage, Count:=X).Start
if .Range.Information(wdActiveEndPageNumber) = X then
pEnd = .Range.End
else
pEnd = .GoTo(What:=wdGoToPage, Count:=X+1).Start - 1
end if
.Range(pStart, pEnd).Delete
End with
 
R

Rob Schneider

D. Reese said:
Is it possible to delete an entire page in a lengthy Word
document without highlighting text?

You could put the cursor at the beginning of the part of text you wish
to delete, then hold down the "delete" key and it will thus repeat the
"del" key to delete everything in front of it. Conversely, put the
cursor at the end of the part of text you wish to delete, then hold down
the "backspace" key. Short of devine intervention, you have to do
something to delete text.

What's the problem with highlighting the text? I can't think why this
would be an issue, hence my slightly flippant answer :)
 

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