Save pages as individual documents

D

Dawn Crosier, Word MVP

Here is some macro code that will help you...

If you need help in using the code below, then see
http://www.gmayor.com/installing_macro.htm



Sub CopyEachPageToAFile()

'written by dian@mousetrax

'PURPOSE: copies each page in a doc to a newly saved file



'declare vars

Dim intPageNum As Integer

Dim i As Integer



'find out how many pages you have in the doc

intPageNum = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)



'turn off screen updating

Application.ScreenUpdating = False



'from 1 to max pages, do the following

For i = 1 To intPageNum



'go to next page (increments with each pass)

Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=i



'select the current page

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



'copy the page (current selection)

Selection.Copy



'open a new blank page

Documents.Add DocumentType:=wdNewBlankDocument



'dump in copy from clipboard

Selection.Paste



'save the file with some name and current number

ActiveDocument.SaveAs "myFile" & i



'close this new doc

ActiveDocument.Close



'go to next page and do it again

Next i



'turn updating back on

Application.ScreenUpdating = True



End Sub


--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message was posted to a newsgroup, Please post replies and questions
to the group so that others can learn as well.
How do I save a 191 page document as 191 one-page documents?
 

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