Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
hehehe hehehe is offline
external usenet poster
 
Posts: 2
Default microsoft word 2003 save multipage doc to multiple files

Hello!

Is there any possible way to resolve my problem :
I have 60 page document and id like to split this doc to 60 single paged
files. Is there any way to do this whit some magic word option?


Reagrds - HE


  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default microsoft word 2003 save multipage doc to multiple files

Is this the result of a mailmerge? In which case see
http://www.gmayor.com/individual_merge_letters.htm and the macros at the end
of that page.

If this is a simple document that is not the result of a merge, then the
following macro may help, however Word is not a page layout application and
'page' is thus a vague concept, so unlike splitting a mailmerge by file, the
results are not entirely predicatble. Much depends what is in the document.

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

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

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




"hehehe" wrote in message ...
Hello!

Is there any possible way to resolve my problem :
I have 60 page document and id like to split this doc to 60 single paged
files. Is there any way to do this whit some magic word option?


Reagrds - HE




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
Mail Merge to multiple docs to save as multiple files jimbeem16 Mailmerge 7 December 3rd 09 07:24 AM
Combining Multiple MS Word Files - Error Message Upon Save As ms300game Microsoft Word Help 2 October 8th 09 09:13 PM
Insert multiple text files in microsoft word DennisM Microsoft Word Help 7 May 14th 06 04:15 PM
I can't get Microsoft Word to retrieve or save files...Help! patt Microsoft Word Help 2 April 20th 06 09:03 PM
Microsoft Word very slow to save/view files Stephen Brownell Microsoft Word Help 0 January 16th 05 05:25 PM


All times are GMT +1. The time now is 04:39 AM.

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"