j***e 发帖数: 186 | 1 Sub SeparatePagesFromDocument()
Dim rng As Range
Dim i As Integer
Dim oDoc As Document, nDoc As Document
Set oDoc = ActiveDocument
For i = 1 To oDoc.BuiltInDocumentProperties(wdPropertyPages)
Set rng = oDoc.GoTo(what:=wdGoToPage, which:=wdGoToAbsolute, Count:=i)
rng.Select
Set rng = Selection.Bookmarks("\page").Range
rng.Select
rng.Copy
Set nDoc = Documents.Add
nDoc.Range.PasteSpecial
nDoc.SaveAs "C:\temp\" & Replace(oDoc.Name, ".doc", "") & "-Part-" & i
nDoc.Close
Next i
Set r |
|