§Sub MakeSureColumnExists()
§ Dim symMgr As McadSymbolBBMgr
§ Set symMgr =
Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
§
§ ' let's make
sure that this column is part of the BOM
§ Dim strCol As String
§ strCol = "MyColumn"
§
§ Dim isFound As Boolean
§ isFound = False
§
§ ' let's look
for the column
§ Dim symColDef As McadColumnDefinition
§ For Each symColDef In symMgr.StandardMgr.CurrentStandard.BOMStandard.Columns
§ Debug.Print symColDef.Name
§
§ If
symColDef.Caption = strCol Then
§ isFound = True
§ End If
§ Next
§
§ ' it's not
there yet, so let's create it
§ If Not isFound Then
§ ' this will
add it to the BOM Properties dialog
§ Set symColDef =
symMgr.StandardMgr.CurrentStandard.BOMStandard.AddColumn( _
§ sbUnknownType, sbGeneralText,
strCol, strCol)
§ End If
§
§ ' make sure it is visible (it is by
default)
§ symColDef.IsVisible = True
§End
Sub