Make a user-defined field searchable
Public Sub MakeUDFSearchable()
' Make a user-defined field searchable

    Dim custFields As CustomizationFields
    Dim aCustField As CustomizationField
    Dim cust As Customization
    ' Get the customization fields object.
    Set cust = tdc.Customization
    Set custFields = cust.Fields
    ' Output the list of potentially searchable fields.
    Dim cFs As List
    Set cFs = custFields.Fields("Test")
    For Each aCustField In cFs
        If aCustField.CanMakeSearchable Then
            Debug.Print aCustField.CanMakeSearchable & vbTab & aCustField.ColumnName
            Debug.Print aCustField.IsSearchable
        End If
    ' Make a user-defined field searchable.
    Set aCustField = custFields.Field("Test", "TS_USER_01")
    If aCustField.CanMakeSearchable Then
        aCustField.IsSearchable = True
        MsgBox "Field cannot be made searchable"
    End If

End Sub