I have a 25 page document. How do I separate the page numbers

  • Thread starter Thread starter Miss E
  • Start date Start date
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

'

Dim Counter As Long, Source As Document, Target As Document

Set Source = ActiveDocument

Selection.HomeKey Unit:=wdStory

Pages = Source.BuiltInDocumentProperties(wdPropertyPages)

Counter = 0

While Counter < Pages

Counter = Counter + 1

DocName = "Page" & Format(Counter)

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

Set Target = Documents.Add

Target.Range.Paste

Target.SaveAs FileName:=DocName

Target.Close

Wend

End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
Got Suzanne's crystal ball today Doug? <g>
--
Cheers!

Gordon Bentley-Mix
Word MVP

Please post all follow-ups to the newsgroup.

Read the original version of this post in the Office Discussion Groups - no
membership required!
 
Nah, mine's better.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Gordon Bentley-Mix on news.microsoft.com"
 
Must be a bloody good one if you managed to work out that answer from that
question... ;-P
--
Cheers!

Gordon Bentley-Mix
Word MVP

Please post all follow-ups to the newsgroup.

Read the original version of this post in the Office Discussion Groups - no
membership required!
 
The code will separate the page numbers. Each one of them will be in a
separate file. While the filename will be the same as the page number that
was on the original page, the page number in the file will not however.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
It helps that he just happens to have a macro already prepared for the
purpose. <g>

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
Back
Top