+ -
当前位置:首页 → 问答吧 → [请问]如何按照分节符将一个文档另存为多个文档

[请问]如何按照分节符将一个文档另存为多个文档

时间:2007-11-18

来源:互联网

请问如何按照分节符将一个文档另存为多个文档 mvfKvuj7.rar (2.66 KB)
mvfKvuj7.rar (2.66 KB)
[请问]如何按照分节符将一个文档另存为多个文档
下载次数: 18
2007-11-18 13:13

[此贴子已经被作者于2007-11-18 13:13:50编辑过]

作者: wdwc   发布时间: 2007-11-18

在大纲模式下,将节适当处理一下,创建子文档,保存即得。

作者: c81   发布时间: 2007-11-18

果然,谢谢!

问题已解决。

能不能用宏实现?以(分节符-下一页)为单位?

作者: wdwc   发布时间: 2007-11-18

QUOTE:
以下是引用wdwc在2007-11-18 22:27:55的发言:

果然,谢谢!

问题已解决。

能不能用宏实现?以(分节符-下一页)为单位?

Sub test()
   Dim mySec As Section, i As Long, myDoc As Document, SourceDoc As Document
   Set SourceDoc = ActiveDocument
   For Each mySec In SourceDoc.Sections
      If mySec.PageSetup.SectionStart = wdSectionNewPage And mySec.Index > 1 Then
         Set myDoc = Application.Documents.Add
         myDoc.Content.FormattedText = SourceDoc.Range(i, mySec.Range.Start - 1)
         myDoc.Content.Sections.Last.PageSetup.SectionStart = _
                  SourceDoc.Range(i, mySec.Range.Start - 1).Sections.Last.PageSetup.SectionStart
         i = mySec.Range.Start
      End If
      If mySec.Index = SourceDoc.Sections.Count Then
         Set myDoc = Application.Documents.Add
         myDoc.Content.FormattedText = SourceDoc.Range(i, SourceDoc.Content.End)
         myDoc.Content.Sections.Last.PageSetup.SectionStart = _
                  SourceDoc.Range(i, SourceDoc.Content.End).Sections.Last.PageSetup.SectionStart
      End If
  
   Next
End Sub

作者: chylhr   发布时间: 2007-11-26

谢谢chylhr

作者: wdwc   发布时间: 2007-11-28

四楼!高手!

作者: lion1982921   发布时间: 2007-12-01

四楼的方法真是好!学习了,多谢!

作者: wslh   发布时间: 2010-05-07

引用:
原帖由 chylhr 于 2007-11-26 18:10 发表
QUOTE:以下是引用wdwc在2007-11-18 22:27:55的发言:果然,谢谢!问题已解决。能不能用宏实现?以(分节符-下一页)为单位?Sub test()   Dim mySec As Section, i As Long, myDoc As Document, SourceDoc ...
代码很好!!
怎样自动保存?自动命名?

作者: szqhb   发布时间: 2011-03-26

热门下载

更多