VBA Collapse Items

Is it possible to collapse Items with VBA?


I found this code but it’s very long and not use this short cut
https://help.solidworks.com/2017/english/api/sldworksapi/expand_and_collapse_featuremanager_design_tree_nodes_vb.htm
Edit: Without sendkeys if possible because sendkeys cut caps lock

SwApp.RunCommand((int)swCommands_e.swCommands_Collapseallitems_Tree, “Bla bla bla”);

1 Like

@JJZ, thanks a lot.
It’s working great.
Code VBA:

swApp.RunCommand swCommands_Collapseallitems_Tree, ""
1 Like