word怎样将文本按页拆分 将word拆分成两个word - 电脑知识 - 【三明电脑网】_三明电脑维修_三明笔记本电脑维修_监控安装_市区上门维修

全国统一24小时服务热线:400-0000-000400-0000-000  / 1399000000

当前位置:首页 > 电脑知识 > 正文

word怎样将文本按页拆分 将word拆分成两个word

发布日期:2020-09-04

摘要:如何将一个word文档按页拆分成多个文档 1、在Word里面打开那个需要分割的文档(假设它的文件名叫做“原始文档 doc”);键入ALT+F11打开VBA编辑器,选择菜单“插入-模块”;粘贴下面的代码...

word怎样将文本按页拆分

如何将一个word文档按页拆分成多个文档

1、在Word里面打开那个需要分割的文档(假设它的文件名叫做“原始文档.doc”);键入ALT+F11打开VBA编辑器,选择菜单“插入-模块”;粘贴下面的代码:Option ExplicitSub SplitPagesAsDocuments()Dim oSrcDoc As Document, oNewDoc As DocumentDim strSrcName As String, strNewName As StringDim oRange As RangeDim nIndex As IntegerDim fso As ObjectSet fso = CreateObject("Scripting.FileSystemObject")Set oSrcDoc = ActiveDocumentSet oRange = oSrcDoc.ContentoRange.Collapse wdCollapseStartoRange.SelectFor nIndex = 1 To ActiveDocument.Content.Information(wdNumberOfPagesInDocument)oSrcDoc.Bookmarks("\page").Range.CopyoSrcDoc.Windows(1).ActivateApplication.Browser.Target = wdBrowsePageApplication.Browser.NextstrSrcName = oSrcDoc.FullNamestrNewName = fso.BuildPath(fso.GetParentFolderName(strSrcName), _fso.GetBaseName(strSrcName) & "_" & nIndex & "." & fso.GetExtensionName(strSrcName))Set oNewDoc = Documents.AddSelection.PasteoNewDoc.SaveAs strNewNameoNewDoc.Close FalseNextSet oNewDoc = NothingSet oRange = NothingSet oSrcDoc = NothingSet fso = NothingMsgBox "结束!"End Sub键入F5运行,看到“完成!”结束。

2、检查当前文档所在路径下是否生成若干名为“原始文档_n.doc”(n代表其对应原始文档中的第几页)的文档,检查它们的内容是否就对应于原始文档每个页面的内容。

如文档中有分节符分解后的文档会出现空白页,如要分解后不出现空白页,需要把文档中的分节符删除。

消除分节符的方法:注意事项分节符若全部替换,要注意替换后文档可能会出现排版混乱,这则需要自己手动排版了。

如何将一个word文档按页分割成多个word文档

1、打开需要拆分的文档2、将需要拆分的章节标题样式选中“标题1”3、选择大纲视图——显示1级标题——点击显示文档4、双击第一章前面的“+”号以显示第一章全部内容,点击创建,将第一章进行拆分5、双击图中所示文本标志。

6、会自动弹出新word窗口,新word文档为全部第一章节内容,点击保存即可。

然后重复上面步骤,将其他章节进行拆分。

如何将一个word文档按页分割成多个word文档

1、单击【常用】工具栏中的【新建空白文档】按钮,创建一个空文档。

2、选择【视图】菜单中的【大纲】菜单项,并切换到大纲视图下。

此时【大纲】工具栏自动激活,【大纲】工具栏及各按钮的具体含义。

3、输入文档的大纲,并用内置的标题样式对各级标题进行格式化。

4、选定要拆分为子文档的标题和文本。

注意选定内容的第一个标题必须是每个子文档开头要使用的标题级别。

例如,所选内容中的第一个标题样式是“ 标题3”,那么在选定的内容中所有具有“标题3”样式的段落都将创建一个新的子文档。

选定的方法是鼠标移到该标题前的空心十字符号,此时鼠标指针变成十字箭头,单击鼠标即可选定该标题包括的内容。

5、单击【大纲】工具栏中的【创建子文档】按钮,原文档将变为主控文档,并根据选定的内容创建子文档。

可以看到,Word 把每个子文档放在一个虚线框中,并且在虚线框的左上角显示一个子文档图标,子文档之间用分节符隔开。

6、把文件保存下来即可。

Word 在保存主文档的同时,会自动保存创建的子文档,并且以子文档的第一行文本作为文件名。

VB 怎么按页拆分word文档?

下面是按页拆分word文档的程序,请参考:Option Explicit Dim oWord As Word.Application Dim oDoc As Word.Document Dim oNewDoc As Word.Document Dim oRange As Word.Range Dim iPageNumber As Integer Dim iCount As Integer Dim strTestDir As String Dim strTestFile As String Private Sub Command1_Click() Command1.Visible = False Dim lCurrentStart As Long Dim lCurrentEnd As Long Dim lDocumentEnd As Long Dim lOutputCount As Long lOutputCount = 0 "Launch Word and make it visible Set oWord = CreateObject("Word.Application") oWord.Visible = True "Open the test document Set oDoc = oWord.Documents.Open(FileName:="C:\ThreePageDocument.doc") "Find the beginning end of the document oDoc.Select lCurrentStart = oWord.Selection.Start lCurrentEnd = lCurrentStart lDocumentEnd = oWord.Selection.End "Move the insertion point to the beginning of the document oWord.Selection.Collapse wdCollapseStart Do While (lCurrentEnd "Move the insertion pointer to the bottom of this page oWord.Browser.Target = wdBrowsePage oWord.Browser.Next lCurrentEnd = oWord.Selection.End "On the last page, the start and end will be the same If (lCurrentStart = lCurrentEnd) Then lCurrentEnd = lDocumentEnd End If "Capture the Range of the current page Set oRange = oDoc.Range(lCurrentStart, lCurrentEnd) "Create a new document and copy the range to it Set oNewDoc = oWord.Documents.Add oRange.Copy oNewDoc.Range(0, 0).Paste "Release the Range so we don"t leak references Set oRange = Nothing "Save the new document and close it oNewDoc.SaveAs FileName:="C:\Result" & lOutputCount & ".doc" " You can save as another FileFormat. If so, change the " file extension accordingly. oNewDoc.Close Set oNewDoc = Nothing "Increment the output counter so we don"t overwrite this file later lOutputCount = lOutputCount + 1 "Reset the current start position lCurrentStart = oWord.Selection.End Loop End Sub

如何将一个word多页文档拆分为多个单页文档保存

1、视图——大纲,切换到大纲视图,选中要拆分的标题及正文(选定的方法是鼠标移到该标题前的空心十字符号,此时鼠标指针变成十字箭头,单击鼠标即可选定该标题包括的内容)2、单击【大纲】工具栏中的【创建子文档】按钮,每个子文档会放在一个虚线框中,并且在虚线框的左上角显示一个子文档图标,子文档之间用分节符隔开。

3、把文件保存下来即可。

Word 在保存主文档的同时,会自动保存创建的子文档,并且以子文档的第一行文本作为文件名。

...

如何用vba按页数拆分word文档

如果想按照指定页数拆分,请使用下面的代码,其它步骤和原来那个方案相同。

Option ExplicitSub SplitEveryFivePagesAsDocuments()Dim oSrcDoc As Document, oNewDoc As DocumentDim strSrcName As String, strNewName As StringDim oRange As RangeDim nIndex As Integer, nSubIndex As Integer, nTotalPages As Integer, nBound As IntegerDim fso As ObjectConst nSteps = 100 " 修改这里控制每隔几页分割一次Set fso = CreateObject("Scripting.FileSystemObject")Set oSrcDoc = ActiveDocumentSet oRange = oSrcDoc.ContentnTotalPages = ActiveDocument.Content.Information(wdNumberOfPagesInDocument)oRange.Collapse wdCollapseStartoRange.SelectFor nIndex = 1 To nTotalPages Step nStepsSet oNewDoc = Documents.AddIf nIndex + nSteps >nTotalPages ThennBound = nTotalPagesElsenBound = nIndex + nSteps - 1End IfFor nSubIndex = nIndex To nBoundoSrcDoc.ActivateoSrcDoc.Bookmarks("\page").Range.CopyoSrcDoc.Windows(1).ActivateApplication.Browser.Target = wdBrowsePageApplication.Browser.NextoNewDoc.ActivateoNewDoc.Windows(1).Selection.PasteNext nSubIndexstrSrcName = oSrcDoc.FullNamestrNewName = fso.BuildPath(fso.GetParentFolderName(strSrcName), _fso.GetBaseName(strSrcName) & "_" & (nIndex \ nSteps + 1) & "." & fso.GetExtensionName(strSrcName))oNewDoc.SaveAs strNewNameoNewDoc.Close FalseNext nIndexSet oNewDoc = NothingSet oRange = NothingSet oSrcDoc = NothingSet fso = NothingMsgBox "结束!"End Sub

上一篇:wifi自动连接软件 100%wifi密码破解黑客

下一篇:word制作公章教程 电子公章怎么制作