Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
TONELLAL
495 Views, 5 Replies

Macro functionning for assembly or part

Hello,

I'm trying to create a macro functionning for all parts if the active document is an assembly, or on the part if it is a part. Something like this :

 

Dim oRefDocs As DocumentsEnumerator
Dim oRefDoc As Document
Dim odoc As Document

 

Set odoc = ThisApplication.ActiveDocument

If odoc.DocumentType = kAssemblyDocumentObject Then Set oRefDocs = odoc.AllReferencedDocuments

If odoc.DocumentType = kPartDocumentObject Then Set oRefDocs = odoc

 

For each oRefDoc in oRefDocs

...

next

 

The red line does not function, and I'm stuck... any idea ?