I want to split a document preserving the format try using the following VB scripts but failed to keep the format after file split into 110 files .
Can someone help to rectify the errors
Sub Split()
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
Set Letter = Source.Sections(i).Range
Set Target = Documents.Add
Target.Range = Letter
Target.Sections(1).PageSetup.SectionStart = wdSectionContinuous
Source.Range.FormattedText = Target.Range.FormattedText
Target.SaveAs FileName:="C:DATA" & "Letter to Creditor inviting views - " & i
Target.Close
Next i
End Sub
Pls respond with better codes
Thanks
What if you tell us more first?
You don't give any version information and I doubt very much that this is an Excel question
Sorry this is Word document macro request.
I'm out then
Thanks
Hello,
I asked Copilot. Don't know if it works though.
Thanks millions Anders, will give it a go with live data and file.
I try the macro but still failed