Here is a simple way to use the macro, just select a parts list and then run the Sub below
(ALSO, this works best if you are using a monospace font, I don't know how it will work for a variable width font)
--------------------------------------------------------------------
Public Sub PartsListSelectedFitColumns()
Dim oPartsList As PartsList
Set oPartsList = GetSelectedPartsList
If oPartsList Is Nothing Then Exit Sub
PartsListFitColumns oPartsList
End Sub
Public Function GetSelectedPartsList() As PartsList
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = GetActiveDrawing
If oDrawDoc Is Nothing Then Exit Function
Dim oSelectSet As SelectSet
Set oSelectSet = oDrawDoc.SelectSet
If oSelectSet.Count = 0 Then Exit Function
If oSelectSet.Item(1).Type <> kPartsListObject Then Exit Function
Set GetSelectedPartsList = oSelectSet.Item(1)
End Function
Public Function GetActiveDrawing() As DrawingDocument
If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Set GetActiveDrawing = ThisApplication.ActiveDocument
Else
MsgBox "Must have a drawing active", vbOKOnly, "Error"
End If
End Function