Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have had trouble finding code that removes only unresolved OLE links on any inventor document. finally got one to work. thought i'd share.
coded on Ilogic Inventor 2014. I'm not a professional coder, feel free to correct syntax
SyntaxEditor Code Snippet
ThisApplication.SilentOperation = True Dim oPartDoc As Document = ThisDoc.Document Dim bSaveDoc As Boolean = False Dim oRefOleFileDesc As ReferencedOLEFileDescriptor If oPartDoc.ReferencedOLEFileDescriptors.Count > 0 Then For Each oRefOleFileDesc In oPartDoc.ReferencedOLEFileDescriptors 'Debug.Print oRefOleFileDesc.ReferenceStatus If oRefOleFileDesc.ReferenceStatus() = 49668 Then '49668 = kMissingReferencE 'Debug.Print (oRefOleFileDesc.DisplayName) oRefOleFileDesc.Delete oPartDoc.Dirty = True bSaveDoc = True End If Next oRefOleFileDesc If bSaveDoc = True Then oPartDoc.Save bSaveDoc = False End If End If ' Be sure to set this back to False ThisApplication.SilentOperation = False
Solved! Go to Solution.