' 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 ' modified 28-09-2010 to use filename of the last 9 digits of the first paragraph Dim Counter As Long, Source As Document, Target As Document Dim Docname As Range 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 Set Docname = Target.Range.Paragraphs(1).Range Docname.Start = Docname.End - 10 Docname.End = Docname.End - 1 Target.SaveAs filename:=Docname.Text Target.Close Wend
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)