I tried the following code, but an error results in the 6th line, indicating that an object is required.
Set objFile = fso.GetFile(File)
Set wrd = GetObject(, "Word.Application")
wrd.Visible = False
wrd.Documents.Open objFile.Path
Set oFile = wrd.ActiveDocument
Set rowcount = oFile.Tables(1).Rows.Count
WScript.Echo "The number of rows is " & rowcount
This is in a WSH *.vbs script in which an RTF file with a single table is chosen. I need to know the number of rows in that table so I can do some loops in particular cell ranges to update the content of that table.