How do I select the current page in a word document


M

Maureen

I have a 60 page document, and I need to create a new
document, select and copy a page and paste the page onto
the new document, go to the next page and repeat. Instead
of highlighting and scrolling down each page, is there a
control key I can use to Select the current page???
 
Ad

Advertisements

D

Doug Robbins

The following macro will do it all for you

Sub splitter()

'

' splitter Macro

' Macro created 16-08-98 by Doug Robbins to save each page of a document

' as a separate file with the name Page#.DOC

'

Selection.HomeKey Unit:=wdStory

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)

Counter = 0

While Counter < Pages

Counter = Counter + 1

DocName = "Page" & Format(Counter)

ActiveDocument.Bookmarks("\Page").Range.Cut

Documents.Add

Selection.Paste

ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _

wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _

True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _

False, SaveNativePictureFormat:=False, SaveFormsData:=False, _

SaveAsAOCELetter:=False

ActiveWindow.Close

Wend



End Sub

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
Ad

Advertisements

G

Graham Mayor

But for a single page - try

Sub CopyCurrentPageToNewDoc()
ActiveDocument.Bookmarks("\page").Range.Select
Selection.Copy
Documents.Add Template:="Normal"
Selection.Paste
End Sub

Note that 'page' is a vague concept in Word which is not a page layout
application. You may find that a macro solution like this does not transfer
all the elements on a page.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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