View Single Post
 
Old 03-22-2021, 06:28 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default

Thanks, Andrew, It's a great Start.
i've tried it, I don't know why, it gives me 5, when the most columns I had was 9.
I've created some mini tables, from 2 to 9, and still say's 5.

Well your code us much better than mine, cause I've taken parts from other macro's, and what ever I've done, but I keep getting error message. I was thinking it can't be done until your answer.

Code:
Sub TST_Msg_eCount_Tables_Columns()
'98
Dim Tbl As Table

If ActiveDocument.Tables.Count >= 1 Then
 
   'MsgBox ActiveDocument.Tables(1).Columns.Count
   'MsgBox Selection.Information(wdMaximumNumberOfColumns)
   MsgBox Information(wdMaximumNumberOfColumns)

 End If
End Sub
I'm back at work now, so I'll try maybe tonight, unless you find a reasons why it keeps saying 5. What ever I find, I'll let you know.

Thanks a million, it's a great start At least I'm going forward with your script
Reply With Quote