Manual can set the General table width,
API set General table width → set columnwidth→ sum columnwidth.
Hope, how to get general table withdth with API
Sub ll1()
Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2, SwDraw As DrawingDoc
Dim SwView As View, SwTable As TableAnnotation, SwAnn As Annotation
Set SwApp = GetObject(, "SldWorks.Application")
Set SwModel = SwApp.ActiveDoc
Set SwDraw = SwModel
Set SwView = SwDraw.GetFirstView
Set SwTable = SwView.GetFirstTableAnnotation
Dim X, Y, Z As Integer, Anch
X = 25: Y = 5
SwTable.AnchorType = 3
Dim ColWidth As Double
Dim SwFeat As Feature
With SwTable ''
.Merge 0
.Split 1, 13 ''
For jj = 0 To .ColumnCount
.SetColumnWidth jj, 0.02, 0
ColWidth = ColWidth + .GetColumnWidth(jj)
Next jj ''
For ii = 0 To .RowCount - 1
.SetRowHeight ii, 0.005, 0
Next ii
.BorderLineWeight = 2
End With
Do While Not SwTable Is Nothing
Set SwFeat = SwTable.GeneralTableFeature.GetFeature
Debug.Print SwFeat.Name, SwTable.Title
Set SwAnn = SwTable.GetAnnotation
'Debug.Print SwTable.Title
'ss = SwTable.GetAnnotation.GetPosition
SwAnn.SetPosition X / 1000, Y / 1000, 0
'Stop
Set SwTable = SwTable.GetNext
X = X + ColWidth * 1000
Loop
End Sub
I don't think you can get the width of the entire table, but you can get the width of each column (which you already seem to be doing), and add them together.
For jj = 0 To .ColumnCount
.SetColumnWidth jj, 0.02, 0
ColWidth = ColWidth + .GetColumnWidth(jj)
TotalWidth = TotalWidth + ColWidth 'add this row
Next jj