1、CTRL + SHIFT + X 并输入以下代码即可全局将comment设置为name。
'Option Explicit On
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl ' the current model
' 取得当前Model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If
Private Sub ProcessFolder(folder)
'处理表
Dim Tab,str1
Dim tt
For Each Tab In folder.tables
'同步表的
Tab.comment= Tab.name
Dim col
For Each col In Tab.columns
'同步字段的
col.comment = col.name
Next
Next
End Sub