vba macro for VaultOpenFromVault Vault Open From Vault idw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I made a few years ago a vba macro in order to open the drawing kid ( idw ) of a part or an assembly.
Since 2022, the macro doesnt work anymore.
I tested it with "VaultOpenFromVault" and "VaultOpenDesignDocFromVault".
Honnestly, It works once but never again.
Now it opens a Dialogbox to search files in the Vault.
I want to open it directly like the command from the model/features tree.
Any Ideas?
Thanks
Public Sub Zeichnungöffnen()
'Get the CommandManager object
Dim oCommandMgr As CommandManager
Set oCommandMgr = ThisApplication.CommandManager
'Get control definition for the line command
Dim oControlDef As ControlDefinition
Dim obj As Object
On Error GoTo Erorr1
Set obj = ThisApplication.ActiveDocument.SelectSet.Item(1)
If (TypeOf obj Is ComponentOccurrence) Then
Set oControlDef = oCommandMgr.ControlDefinitions.Item("VaultOpenFromVault")
Call oControlDef.Execute2(False)
GoTo EndSub:
End If
Erorr1:
Set oControlDef = oCommandMgr.ControlDefinitions.Item("VaultOpenFromVault")
Call oControlDef.Execute2(False)
EndSub:
End Sub