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

Hi,

   Can anybody correct this code to open the partDocument. If "=" sign not there.

Option Explicit

Sub DescriptCheck()

    Dim oApp As Application
    Set oApp = ThisApplication
    
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = oApp.ActiveDocument
    
    Dim oPartDoc As PartDocument
    
    Dim oProp As Property
    
    For Each oPartDoc In oAsmDoc.AllReferencedDocuments
    Set oProp = oPartDoc.PropertySets.Item("Design Tracking Properties").Item("Description")
    
    Dim oVal As Variant
    
    oVal = oProp.Expression
    
    MsgBox (oVal)
    
    If Left(oVal, 1) = "=" Then
    MsgBox ("yes")
    
    Else
    
    'oPartDoc.Open I need this line to open the doc
    
    End If
    
    
    Next

    
End Sub