K
Krzysko
Dim i, j As Integer
wo = New Microsoft.Office.Interop.Word.Application
wo.ShowMe()
wd = wo.Documents.Open("c:\a.doc")
For Each wt As Table In wd.Tables
For i = 1 To wt.Rows.Count
For j = 1 To wt.Rows(i).Cells.Count
Try
If IsNothing(wt.Cell(i, j)) Then Exit For
MsgBox(wt.Cell(i, j).Range.Text())
Finally
j = wt.Columns.Count
End Try
Next j
Next i
Next wt
wo.Quit()
The clause try/catch/finally doesnt catch that error.
For Each doesn't work either.
Thanks for any help.
wo = New Microsoft.Office.Interop.Word.Application
wo.ShowMe()
wd = wo.Documents.Open("c:\a.doc")
For Each wt As Table In wd.Tables
For i = 1 To wt.Rows.Count
For j = 1 To wt.Rows(i).Cells.Count
Try
If IsNothing(wt.Cell(i, j)) Then Exit For
MsgBox(wt.Cell(i, j).Range.Text())
Finally
j = wt.Columns.Count
End Try
Next j
Next i
Next wt
wo.Quit()
The clause try/catch/finally doesnt catch that error.
For Each doesn't work either.
Thanks for any help.