![将文档的每一页拆分为单独的文档?](https://linux22.com/image/1566339/%E5%B0%86%E6%96%87%E6%A1%A3%E7%9A%84%E6%AF%8F%E4%B8%80%E9%A1%B5%E6%8B%86%E5%88%86%E4%B8%BA%E5%8D%95%E7%8B%AC%E7%9A%84%E6%96%87%E6%A1%A3%EF%BC%9F.png)
有没有办法将 85 页的 Word 文档分成 85 个单独的文档?
Adobe Acrobat 可以使用“拆分文档”功能实现这一点。
答案1
Word 中没有内置功能可以执行此操作,但您可以使用宏。
Sub MakeSepDocs()
Dim doc As Word.Document, rng As Word.Range
Dim newDoc As Word.Document, fName As String
Dim sep As String, nbr As Integer, sNbr As String
sep = Application.PathSeparator
Set doc = ActiveDocument
Selection.HomeKey Word.WdUnits.wdStory
fName = Mid(doc.FullName, InStrRev(doc.FullName, sep) + 1, _
InStrRev(doc.FullName, ".") - InStrRev(doc.FullName, sep) - 1)
On Error Resume Next
Repeat:
Set rng = doc.Bookmarks("\page").Range
rng.Select
Set newDoc = Documents.Add
nbr = nbr + 1
sNbr = Format(nbr, "00")
newDoc.Content.FormattedText = rng.FormattedText
newDoc.SaveAs2 doc.path & sep & fName & sNbr, Word.WdSaveFormat.wdFormatXMLDocument
newDoc.Close
DoEvents
doc.Activate
Selection.Collapse Word.WdCollapseDirection.wdCollapseEnd
If Selection.Range.Start = doc.Bookmarks("\EndOfDoc").Range.Start Then Exit Sub
GoTo Repeat
End Sub