Where can I find the ControlDefinitions Cmd list in Red String?

Where can I find the ControlDefinitions Cmd list in Red String?

Stakin
Collaborator Collaborator
992 Views
1 Reply
Message 1 of 2

Where can I find the ControlDefinitions Cmd list in Red String?

Stakin
Collaborator
Collaborator
0 Likes
Accepted solutions (1)
993 Views
1 Reply
Reply (1)
Message 2 of 2

jdkriek
Advisor
Advisor
Accepted solution

Here's VBA from Brian Ekins - that will loop through all the Definitions and write to .txt file.

 

Sub PrintCommandNames() 
    ' Get the CommandManager object. 
    Dim oCommandMgr As CommandManager 
    Set oCommandMgr = ThisApplication.CommandManager 
    
    ' Get the collection of control definitions. 
    Dim oControlDefs As ControlDefinitions 
    Set oControlDefs = oCommandMgr.ControlDefinitions 

    ' Open the file and print out a header line. 
    Dim oControlDef As ControlDefinition 
    Open "C:\temp\CommandNames.txt" For Output As #1 
    Print #1, Tab(10); "Command Name"; Tab(75); _ 
              "Description"; vbNewLine 

    ' Iterate through the controls and write out the name. 
    For Each oControlDef In oControlDefs 
        Print #1, oControlDef.InternalName; Tab(55); _ 
                  oControlDef.DescriptionText 
    Next 

    ' Close the file. 
    Close #1 
End Sub

My iLogic isn't as elegantly formatted in the .txt file, but it works for me

 

Dim sPath As String = "C:\temp\CommandNames.txt" 
Dim oCommandMgr As CommandManager = ThisApplication.CommandManager 
Dim oControlDefs As ControlDefinitions = oCommandMgr.ControlDefinitions 
Dim oControlDef As ControlDefinition 
	If System.IO.File.Exists(sPath) = True Then 
		Dim objWriter As New System.IO.StreamWriter(sPath)
			For Each oControlDef In oControlDefs 
		objWriter.WriteLine(oControlDef.InternalName & " | | " & oControlDef.DescriptionText)
			Next
		objWriter.Close()
		MsgBox("List Written to File")
	Else
		MsgBox("File Does Not Exist")
	End If
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.