Private Sub Command1_Click()
Dim k As Integer
Dim jssapp As Word.Application
Dim jss As Word.Document
CommonDialog1.ShowOpen
Set jssapp = CreateObject("Word.Application")
If CommonDialog1.FileName = "" Then
MsgBox ("请重新选取路径")
Else
Set jss = jssapp.Documents.Open(CommonDialog1.FileName)
jssapp.Visible = True
While fWTT(jss.Tables(k).Cell(1, 1)) <> "计算结果" 'fWTT为去掉字符中的空格和小黑点
k = k + 1 And k <= 13
Wend
Text1.Text = k
End If
Set jssapp = Nothing
Set jss = Nothing
End Sub
你好,谢谢你的回答。
第一,有什么办法可以获得table中数量;
第二,cell(1,1)我可以保证在word中都有。
jss.tables.count就是文档中table的数量,你在调试时设置个断点,可以查看变量的
追问谢谢你的回答。问题还是没有解决,还有什么办法吗?