Public Sub Technical_notes() ' Created by HEGG (AUG 2015) ' This Program will start the ESKD add-in and activate the technical notes command ' once the technical notes dialog box is closed, it will unload the ESKD add-in. ' The library for this technical notes resides in the "Design Data\GOST\technical requirements\*.tr" ' the .tr files can be edited with a regular text editor. Dim app As Application Set app = ThisApplication Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument ' Turn on the ESKD Add-In. Call Activate ' Get the CommandManager object. Dim oCommandMgr As CommandManager Set oCommandMgr = ThisApplication.CommandManager ' Get control definition for the line command. Dim oControlDef As ControlDefinition Set oControlDef = oCommandMgr.ControlDefinitions.Item("Gost.Command.TechRequirements") ' Execute the command. Call oControlDef.Execute ' Turn off the ESKD Add-In. Call Deactivate ' Update the document. app.ActiveDocument.Update ' update the ribbons by editing a sketch Dim oSketch As DrawingSketch Dim oSketches As DrawingSketches Set oSketches = oDoc.ActiveSheet.Sketches For Each oSketch In oSketches If oSketch.Name = "Technical Requirements" Then oSketch.Edit oSketch.ExitEdit End If Next End Sub Public Sub Activate() Dim app As Application Set app = ThisApplication Dim addins As ApplicationAddIns Set addins = app.ApplicationAddIns ' Get the DWF AddIn using its ID Dim AddIn As ApplicationAddIn Set AddIn = addins.ItemById("{005B21FC-8537-4926-9F57-3A3216C294C3}") ' Activate AddIn If AddIn.Activated = True Then Exit Sub Else AddIn.Activate End If End Sub Public Sub Deactivate() Dim app As Application Set app = ThisApplication Dim addins As ApplicationAddIns Set addins = app.ApplicationAddIns ' Get the DWF AddIn using its ID Dim AddIn As ApplicationAddIn Set AddIn = addins.ItemById("{005B21FC-8537-4926-9F57-3A3216C294C3}") ' Activate AddIn If AddIn.Activated = False Then Exit Sub Else AddIn.Deactivate End If End Sub