Message 1 of 4
Collapse All Children in SubAssembly (ActiveEditDocument)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have the following piece of code to collapse all children:
Set oDoc = ThisApplication.ActiveEditDocument
Dim oTopNode As BrowserNode
Set oTopNode = oDoc.BrowserPanes.ActivePane.TopNode
Dim oNode As BrowserNode
For Each oNode In oTopNode.BrowserNodes
'If the node is visible and expanded, collapse it
If oNode.Visible = True And oNode.Expanded = True Then
oNode.Expanded = False
End If
NextThis works for the topassembly, but not for the subassembly. See attachment for a screenshot of my browser. So, the code works if Assembly101 is active (every node is collapsed), but it does not work if Assembly100 is active.
Why does it not work and how do I need to change my code to make it work?
And why does the following code not work (for the topassembly as well as subassemblies)?:
Set oCtrlDef = ThisApplication.CommandManager.ControlDefinitions("AppBrowserCollapseChildrenCmd")
oCtrlDef.Execute
Set oCtrlDef = ThisApplication.CommandManager.ControlDefinitions("AppBrowserCollapseAllCmd")
oCtrlDef.Execute
Thanks in advance,
Dominiek