View Single Post
 
Old 04-02-2019, 09:13 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

In the case of the OrgCharts, there is a setting you could interrogate to find out if it is collapsed or not. Then it is a case of calling the relevant addon macro. If your shape subselects on double clicking then you will need to change Selection to 'Group only' in the behavior dialog.
Code:
Sub ShowerOrGrower()
  Dim sel As Visio.Selection, aShp As Visio.Shape
  Set sel = ActiveWindow.Selection
  Set aShp = sel.PrimaryItem
  If aShp.CellsU("User.ShowSubordinates").Formula = 0 Then
    Call Visio.Application.Addons("OrgC11").Run("/expandsubordinates")
  Else
    Call Visio.Application.Addons("OrgC11").Run("/hidesubordinates")
  End If
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote