You can use below VBA to get query if a custom table is split:
Sub CustomTableSplitData()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
' In UI you select a custom table first
Dim oTable As CustomTable
Set oTable = oDoc.SelectSet(1)
On Error Resume Next
' iNum is sections count
Dim iNum As Long: iNum = 0
iNum = oTable.NumberOfSections
If iNum = 1 Then
MsgBox "The custom table is not split!"
End
End If
If iNum > 1 Then
Dim lRowsOfEachSection As Long
Dim dNum As Double, dTest As Double
dNum = oTable.Rows.Count
dTest = oTable.Rows.Count / iNum
lRowsOfEachSection = oTable.Rows.Count / iNum
If (dTest - lRowsOfEachSection) >= 0.5 Then
lRowsOfEachSection = lRowsOfEachSection + 1
End If
If Not oTable.WrapLeft Then
MsgBox "The custom table is split into " & iNum & " sections:" & vbCrLf _
& "The left section has " & lRowsOfEachSection & " rows."
End
Else
lRowsOfEachSection = oTable.Rows.Count - lRowsOfEachSection * (iNum - 1)
MsgBox "The custom table is split into " & iNum & " sections:" & vbCrLf _
& "The left section has " & lRowsOfEachSection & " rows."
End
End If
End If
Dim lMaxRows As Long: lMaxRows = 0
lMaxRows = oTable.MaximumRows
If lMaxRows = 0 Then
MsgBox "The custom table is not split!"
End
Else
iNum = oTable.Rows.Count / lMaxRows
If iNum * lMaxRows < oTable.Rows.Count Then iNum = iNum + 1
If Not oTable.WrapLeft Then
MsgBox "The custom table is split into " & iNum & " sections:" & vbCrLf _
& "The left section has " & lMaxRows & " rows."
Else
Dim lLeftSectionRows As Long
lLeftSectionRows = oTable.Rows.Count - lMaxRows * (iNum - 1)
MsgBox "The custom table is split into " & iNum & " sections:" & vbCrLf _
& "The left section has " & lLeftSectionRows & " rows."
End If
End If
End Sub
Hope this helps.
If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.
Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.