可以使用iLogic实现,代码如下:
Dim openDoc As Document
openDoc = ThisDoc.Document
Dim docFile As Document
If openDoc.DocumentType = 12291 Then
For Each docFile In openDoc.AllReferencedDocuments
Dim FNamePos As Long
Dim docFName As String
FNamePos = InStrRev(docFile.FullFileName "quot;"quot; -1)
docFName = Mid(docFile.FullFileName FNamePos + 1 Len(docFile.FullFileName) - FNamePos)
If docFile.IsModifiable = True Then
iProperties.Value(docFName "quot;Custom"quot; "quot;客户名称"quot;) = “汇识咨询”
End If
Next
Else
MessageBox.Show("quot;请在部件环境中运行"quot; "quot;类型不符"quot;MessageBoxButtons.OKMessageBoxIcon.Exclamation)
End If