Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
antoniobaron
in reply to: Eide.N

Im not a programmer but Thanks to COVID-19 I have plenty of time to experiment, hope this works for you

 

Sub Main()
' Define a variable that will set the type of document

Dim oComp1occ As Document = ThisDoc.Document

 

'Define the iproperty value that you want in your browser node

Dim strText As String = iProperties.Value("Custom", "DocumentID")

 

'Looks for the type of document and replaces the node value

 

If oComp1occ.DocumentType = kAssemblyDocumentObject Then
Dim oPart As AssemblyDocument = ThisDoc.Document
oPart.DisplayName = strText

 

ElseIf oComp1occ.DocumentType = kPartDocumentObject Then
Dim oPart As PartDocument = ThisDoc.Document
oPart.DisplayName = strText

 

Elseif oComp1occ.DocumentType = kDrawingDocumentObject Then
Dim oPart As DrawingDocument = ThisDoc.Document
oPart.DisplayName = strText

End If

 

end Sub