Re: Deleting Even Pages Within Page-Range
- From: Russ <drsN0SPAMmikle@xxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Jul 2006 00:12:29 -0400
Jason,
I'm wondering if this is possible, and if someone could provide (orYou could try:
point me to) some sample code that would help me build a macro to
accomplish this task...
Let's say I have a 200 page document. The first chapter must remain
static, but all remaining chapters (defined by section breaks) need to
be 'cleaned up' by deleting ALL even-numbered pages.
I would like to bind this to a macro to automate this massive page
deletion process. Ideas?
PS: I've found a code snippet from another thread... how could you
modify it to only delete even pages?
Sub pages_go_away()
Selection.Goto what:=wdGoToPage, which:=wdGoToAbsolute, Count:=4
For counter = 4 to 21
Dim Mycounter As Long
For Mycounter = 20 to 4 Step -2
Selection.Goto what:=wdGoToPage, which:=wdGoToAbsolute, Count:=Mycounter
ActiveDocument.Bookmarks("\page").Select
Msgbox Selection.Information(wdActiveEndAdjustedPageNumber) 'For testing
'Selection.Delete 'Comment out for testing
Next Mycounter
But I agree with Charles that paging depends on what printer is the active
default printer. If the document is using formatting to force blank even
pages, then change that formatting to not use blank even pages. Also look up
the repaginate method in VBA help for repaginating a document.
ActiveDocument.Bookmarks("\page").Select
Selectuion.Delete
Next counter
End Sub
--
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
.
- References:
- Deleting Even Pages Within Page-Range
- From: Jason Stengren
- Deleting Even Pages Within Page-Range
- Prev by Date: Re: Deleting Even Pages Within Page-Range
- Next by Date: Retrieving repeatable data from a database
- Previous by thread: Re: Deleting Even Pages Within Page-Range
- Next by thread: Retrieving repeatable data from a database
- Index(es):
Relevant Pages
|