How do I save a single page of a document separately

F

flytoys

I've made a table several pages long, each page is for a separate department.
How can I save each page separately?
 
P

Peter T. Daniels

I've made a table several pages long, each page is for a separate department.  
How can I save each page separately?

Select the contents of each page, copy it to the clipboard, and paste
it into a new document.
 
G

Greg Maxey

How profound Mr. Daniels.

Flytoys,

If Mr. Daniels suggestion wasn't obvious then you may elect to use it.
However, you can use VBA to create a macro that will make quick work of
performing a repetive task like this.

Sub SaveEachPageAsSeparateDocument()
Dim i As Long
Dim lngPages As Long
Dim oMasterDoc As Word.Document
Dim oDocPart As Word.Document
Dim oRngEmpty As Word.Range
Set oMasterDoc = ThisDocument
lngPages = oMasterDoc.ComputeStatistics(wdStatisticPages)
oMasterDoc.Range(0, 0).Select
For i = 1 To lngPages
oMasterDoc.Bookmarks("\Page").Range.Select
Selection.Copy
Set oDocPart = Documents.Add
oDocPart.Range.Paste
Do
Set oRngEmpty = oDocPart.Paragraphs.Last.Range
If Len(oRngEmpty) = 1 Then oRngEmpty.Delete
Loop Until Len(oRngEmpty) > 1
oDocPart.SaveAs "Document Part " & i
oDocPart.Close
Selection.Collapse wdCollapseEnd
Next i
Set oDocPart = Nothing
Set oDocMaster = Nothing
End Sub

See: http://www.gmayor.com/installing_macro.htm
--
Greg Maxey

See my web site http://gregmaxey.mvps.org
for an eclectic collection of Word Tips.

I've made a table several pages long, each page is for a separate
department.
How can I save each page separately?

Select the contents of each page, copy it to the clipboard, and paste
it into a new document.
 
G

Greg Maxey

Flytoy,

Errata: Set oDocMaster = Nothing should read Set oMasterDoc = Nothing.

Sorry.
 
D

DeanH

If the file is not that long then just SaveAs and delete as necessary, or
copy paste into new file, Save As new file.
If the file is very long see the section "Split the single merged document
into separate letters." in the following webpage.
The webpage starts off at a point before where you are now, but you may get
some ideas.
I use the subsequent section about "Naming the file from the data source" to
great effect, ie the document names itself automatically, saves so much time
and effort :)
Hope this helps
DeanH
 

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