I have a RTF file with a table on each page. I need to get the number of rows and columns of a table on a given page (nPage). To do this, I open the file (FileRTF its size is 150 MB) and get the data I need. However, this takes a very long time to open. Is there a different approach?
VBA Code:
Dim aResult(1) As Integer
Dim nAllPages As Long
Dim nPage As Long
Dim oRTF As Object
Set oRTF = GetObject(FileRTF)
nAllPages = oRTF.Tables.Count
If nPage > nAllPages Then
nPage = nAllPages
End If
aResult(0) = oRTF.Tables(nPage).Columns.Count
aResult(1) = oRTF.Tables(nPage).Rows.Count