将word文档分页 成为N个文档

来源:百度知道 编辑:UC知道 时间:2024/06/24 01:35:31
我只要将一篇200页的文档 分每12页一个新文档就可以了 怎么弄?
怎么录制宏?

200除以12大概的等于17,分别在第17,34,51,68,85,102,119,136,153,170,187页等插入分节符【下一页】。

打开文档,打开VB编辑器,将下面的代码粘贴到编辑器中,F5运行:

Sub BreakOnSection()
' Used to set criteria for moving through the document by section.
Application.Browser.Target = wdBrowseSection
'A mailmerge documents ends with a section break next page.
'Subtracting one from the section count stop error message.
For i = 1 To ((ActiveDocument.Sections.Count) - 1)
'Select and copy the section text to the clipboard
ActiveDocument.Bookmarks("\Section").Range.Copy
'Create a new document to paste text from clipboard.
Documents.Add
Selection.Paste
' Removes the break that is copied at the end of the section, if any.
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1ChangeFileOpenDirectory "C:\"