VB 怎么按页拆分word文档?

来源:百度知道 编辑:UC知道 时间:2024/09/28 09:28:04
我的word中有好多页,我想用VB或VBA拆分成一页一个单独的word文档
请大家帮忙,谢谢
怎么没人理睬呢?
在线等!

谢谢ARTERIOSCLEROS的回答,但是我运行程序时,提示下面的代码有问题:“对象不支持该属性或方法”
For Each page In d.ActiveWindow.ActivePane.Pages

请问怎么回事?

下面是按页拆分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<