Dim DocApp As Word.Application '声明类型
Dim aDoc As Word.Document
Dim DocTable As Word.Table
Dim mReadPathStr As String
mReadPathStr = "C:\Documents and Settings\Administrator\桌面\Test\test.dot"
Set DocApp = CreateObject("Word.Application")
DocApp.Documents.Open (mReadPathStr)
Set aDoc = DocApp.Documents(mReadPathStr)
MsgBox aDoc.Tables(2).Rows <=====出错 如何获得当前Word 表格行数
DocApp.Quit
Set DocApp = Nothing
aDoc.Close
Set aDoc = Nothing
[此贴子已经被作者于2004-7-20 13:26:36编辑过]
|