Word VBA 自动统计表格数量脚本
以下是使用 VBA 编写的 Word 自动统计表格数量的脚本:
Sub CountTables()
Dim tblCount As Integer
tblCount = ActiveDocument.Tables.Count
MsgBox 'There are ' & tblCount & ' tables in this document.'
End Sub
这个脚本使用 ActiveDocument.Tables.Count 属性获取当前文档中表格的数量,并将其存储在一个变量中。然后,使用 MsgBox 函数显示一个消息框,其中包含表格数量的信息。您可以将此脚本添加到 Word 的宏中,并通过快捷键或菜单项来运行它。
原文地址: https://www.cveoy.top/t/topic/jrLV 著作权归作者所有。请勿转载和采集!