cancel
Showing results for 
Search instead for 
Did you mean: 

Get Table number in Word using VBO

Byaswant
Level 2

Is there any action or way to get number of tables present in Word Document?

1 REPLY 1

tim.dauti
Level 3

Add an action on word vbo with a code like this 

Dim objWord As Object
Dim doc As Object
Dim tableCount As Integer

objWord = GetDocument(application, "DocumentPath")
doc = objWord.Documents.Open("C:\Path\To\Your\Document.docx")

tableCount = doc.Tables.Count

' Return the table count
Outputs("TableCount") = tableCount
doc.Close
objWord.Quit