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

Hi, you mean like this? As it is it's without the selection, so it simply changes all the parts. I believe you can set up the selection by yourself, but let me know if not.

 

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim aDoc As DocumentsEnumerator = oDoc.AllReferencedDocuments
Dim iDoc As Document
For Each iDoc In aDoc
    'Here we set iProperties in each of the parts in assembly
    Dim sTS As String = iDoc.FullFileName
    Dim FNamePos As Long = InStrRev(sTS, "\", - 1)
    Dim docFName As String = Mid(sTS, FNamePos + 1, Len(sTS) - FNamePos)
    iProperties.Value(docFName, "Custom", "PropertyName1") = "some text"
    iProperties.Value(docFName, "Custom", "PropertyName2") = "more text"
Next
'Here we set the assembly's iProperties
iProperties.Value("Custom", "PropertyName1") = "even more text"
iProperties.Value("Custom", "PropertyName2") = "and more"
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods