把OLE对象中的word文档保存到一个临时目录会不会?
不会?我FAINT!那下面也不用看了
'函数:获取WORD文档的页数
Function GetDocPageNum(FileName As String)
Dim WordApp, WordDoc
Set WordApp = CreateObject("Word.Application")
WordApp.Visible = False
Set WordDoc = WordApp.Documents.Open(FileName, , True)
GetDocPageNum = WordDoc.BuiltInDocumentProperties("Number of pages")
WordDoc.Close False
WordApp.Quit
End Function
'演示的例子
Sub test()
MsgBox GetDocPageNum("c:\aaa.doc")
End Sub