Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Edwin Edwin is offline
external usenet poster
 
Posts: 3
Default How to split pages in Word into seperate files?

I have a hundred pages of Word document and I need to split each page into a
new Word file. Please help.
I need 100 different word documents with single page.
Any try would be appreciated. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How to split pages in Word into seperate files?

See http://www.gmayor.com/individual_merge_letters.htm

The following will split a document by page into the folder selected in the
macro into consecutively numbered files. The macro creates the new documents
based on the normal template.


Sub SplitByPage()
Dim sPath As String
Dim sName As String
Dim Letters As Long
Dim rDoc As Document
Dim rLoad As String
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.Title = "Select Folder To Save Split Files and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User"
Exit Sub
End If
DocDir = fDialog.SelectedItems.Item(1)
If Right(DocDir, 1) "\" Then DocDir = DocDir + "\"
End With
Set rDoc = ActiveDocument
With rDoc
If Len(.Path) = 0 Then
.Save
End If
If UCase(Right(.name, 1)) = "X" Then
sName = Left(.name, Len(.name) - 5)
Else
sName = Left(.name, Len(.name) - 4)
End If
rLoad = rDoc.FullName
End With
With Selection
.EndKey Unit:=wdStory
Letters = .Information(wdActiveEndPageNumber)
.HomeKey Unit:=wdStory
End With
Counter = 1
While Counter Letters + 1
Application.ScreenUpdating = False
docName = DocDir _
& sName & Chr(32) & _
LTrim$(Str$(Counter)) & ".doc"
ActiveDocument.Bookmarks("\page").Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=docName, _
FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
rDoc.Close wdDoNotSaveChanges
Documents.Open rLoad
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Edwin wrote:
I have a hundred pages of Word document and I need to split each page
into a new Word file. Please help.
I need 100 different word documents with single page.
Any try would be appreciated. Thanks in advance.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Numbering Pages in A Large Document Split Across Multiple Files CuriousGeorge Microsoft Word Help 1 September 12th 06 10:56 AM
To seperate the pages? silentlady Microsoft Word Help 1 January 13th 06 12:55 AM
how to seperate the pages? silentlady Microsoft Word Help 3 January 12th 06 11:20 PM
how can I split the every pages of a file and save them seprately in another files? Charles Kenyon Formatting Long Documents 1 October 4th 05 07:51 AM
Can you save individual document pages as seperate word files? John Calligy Mailmerge 2 April 12th 05 09:14 AM


All times are GMT +1. The time now is 06:16 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"