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

Hi,

 

Then this is what you need

'Open BOM editor dialog box
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyBillOfMaterialsCmd")
oCtrlDef.Execute

If you want to print all commandnames, there is a snippet in de vba help that does this, very helpfull and i have this file all the time with me Smiley Wink

 

Sub PrintCommandNames()
    Dim oControlDefs As ControlDefinitions
    Set oControlDefs = ThisApplication.CommandManager.ControlDefinitions

    Dim oControlDef As ControlDefinition
    
    Open "C:\temp\CommandNames.txt" For Output As #1

    Print #1, Tab(10); "Command Name"; Tab(75); "Description"; vbNewLine
    
    For Each oControlDef In oControlDefs

        Print #1, oControlDef.InternalName; Tab(55); oControlDef.DescriptionText
        
    Next
    Close #1
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"