Deleting everything between two page breaks

D

Devin Rader

Is there an easy way to delete all of the content between two page breaks?

devin
 
H

Helmut Weber

Hi Devin,

in case they are manual pagebreaks und the
start of the insertion point is on the page,
you want to have blank:

Sub Test8465()
MsgBox ActiveDocument.Range.Information(wdNumberOfPagesInDocument)
With Selection
.Collapse
.Bookmarks("\page").Select
.End = Selection.End - 1 ' this is the next pagebreak
' which is on the actual page
.Delete
End With
MsgBox ActiveDocument.Range.Information(wdNumberOfPagesInDocument)
End Sub


Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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