在VB中如何知道word中有几个表格?

来源:百度知道 编辑:UC知道 时间:2024/07/04 08:02:23
我的一个word表格里面有很多表格,怎样在VB中获取表格总数?
有这个函数么?

MsgBox ActiveDocument.Tables.Count
这个不能得到插入的excel表格,只能得到普通表格的个数

下面的语句可以得到excel表格的个数
For Each exsheet In ActiveDocument.InlineShapes
exsheet.OLEFormat.ClassType = "Excel.Sheet.8" Then
i = i + 1
End If
Next exsheet
MsgBox i

没吧

用sql语句查询 用count(*)就行了