PC Review


Reply
Thread Tools Rate Thread

How to delete even or odd pages in a document

 
 
=?Utf-8?B?WWFubg==?=
Guest
Posts: n/a
 
      2nd Nov 2006
Hi,

I have a 160 pages document in which I need to delete all even pages.
Any idea how to do that? Is there any script that could do that?

Thanks in advance,
Yann
 
Reply With Quote
 
 
 
 
Cindy M.
Guest
Posts: n/a
 
      9th Nov 2006
Hi =?Utf-8?B?WWFubg==?=,

> I have a 160 pages document in which I need to delete all even pages.
> Any idea how to do that? Is there any script that could do that?
>

I suppose it would be possible, using a macro... Here's one that works
in a quick test, for me

Sub RemoveAllEvenPages()
Dim doc As Word.Document
Dim pgNr As Long
Dim rng As Word.Range

Set doc = ActiveDocument
Selection.EndKey Unit:=wdStory
pgNr = Selection.Information(wdActiveEndPageNumber)
Do While pgNr > 1
If pgNr Mod 2 = 0 Then
Set rng = doc.Bookmarks("\Page").Range
rng.Delete
End If
pgNr = pgNr - 1
Selection.GoTo What:=wdGoToPage, Count:=pgNr
Loop
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I delete an entire document of 36 pages? Cathy Microsoft Word Document Management 3 19th Jun 2008 03:20 PM
Delete pages in document sidcliffe Microsoft Word New Users 6 10th Dec 2006 05:31 PM
Delete Pages within a Document =?Utf-8?B?U2hhbg==?= Microsoft Word Document Management 2 20th Oct 2006 05:58 AM
How do I delete certain pages from a word document? =?Utf-8?B?ZHl3?= Microsoft Word Document Management 6 20th Jul 2006 05:00 AM
delete different pages from document? Say pages 2,6, and 13 =?Utf-8?B?cnBzb2FweQ==?= Microsoft Word New Users 2 9th Nov 2004 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 PM.