-
Split multi page document to seperate page documents
Does anyone know how to split multi page document with headerandfooters to seperate page documents. I have been trying to split it with this code below but for some reason the splitted documents end up with two pages instead of only one pages.
[VBA]Sub SplittingDocumentIntoPages()
' Used to set criteria for moving through the document by page.
Application.Browser.Target = wdBrowsePage
For i = 1 To ActiveDocument.BuiltInDocumentProperties("Number of Pages")
'Select and copy the text to the clipboard.
ActiveDocument.Bookmarks("\page").Range.Copy
' Open new document to paste the content of the clipboard into.
Documents.Add
Selection.Paste
' Removes the break that is copied at the end of the page, if any.
Selection.TypeBackspace
ChangeFileOpenDirectory "H:\My Documents\"
DocNum = DocNum + 1
ActiveDocument.SaveAs FileName:="Abrechnung_" & DocNum & ".doc"
ActiveDocument.Close
' Move the selection to the next page in the document.
Application.Browser.Next
Next i
End Sub[/VBA]
Pleas have a look at the attachement and try it out yourself. Even the split procedure posted somewhere else in this forum doesn't work with my documents.
Any help is highly appreciated
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules