convert Page Breaks to new word files

D

ddl76

Dear all,

Is there any way I can convert a word doc with around 20 pages to 20 word
files base on the Page breaks as separators?

Thanks a million.

ldl
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi ddl76,

The following macro will do that:

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
'
Selection.HomeKey Unit:=wdStory
Pages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
Counter = 0
While Counter < Pages
Counter = Counter + 1
DocName = "Page" & Format(Counter)
ActiveDocument.Bookmarks("\Page").Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Wend

End Sub

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

ddl

Oh..Thanks for your kindness.

How do I run this macro? Sorry for my ignorance. I am only a novice VBA
user.

Thanks again.


"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Ddl,

See the article “What do I do with macros sent to me by other newsgroup
readers to help me out?” at:

http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
Top