B
Brian
Hello all,
I have been trying to amend Dougs splitter macro to split the documents by
heading1 with little success. Any suggestions would be gratefully received.
Dim Counter As Long, Source As Document, Target As Document
Dim myRange As Range
Set myRange = ActiveDocument.Range.Style = wdStyleHeading1
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory
'Section = Source.BuiltInDocumentProperties(wdSectionOddPage)
Counter = 0
While Counter < myRange
Counter = Counter + 1
DocName = "Heading1" & Format(Counter)
Source.Bookmarks("\myRange").Range.Cut
Set Target = Documents.Add
Target.Range.Paste
Target.SaveAs FileName:=DocName
Target.Close
Wend
Thanks,
I have been trying to amend Dougs splitter macro to split the documents by
heading1 with little success. Any suggestions would be gratefully received.
Dim Counter As Long, Source As Document, Target As Document
Dim myRange As Range
Set myRange = ActiveDocument.Range.Style = wdStyleHeading1
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory
'Section = Source.BuiltInDocumentProperties(wdSectionOddPage)
Counter = 0
While Counter < myRange
Counter = Counter + 1
DocName = "Heading1" & Format(Counter)
Source.Bookmarks("\myRange").Range.Cut
Set Target = Documents.Add
Target.Range.Paste
Target.SaveAs FileName:=DocName
Target.Close
Wend
Thanks,