#1
|
|||
|
|||
Expand/Hide Subordinates with double click
Hi,
I'm trying to create an organisation chart where the subordinates are expanded or hidden by double clicking on the manager. At the moment, I use this macro using the "Behaviour" option on double click: Sub Expand() Call Visio.Application.Addons("OrgC11").Run("/expandsubordinates") End Sub But ideally I'd like double click to be "hide/expand subordinates", swapping them to the opposite state they're initially in. Anyone able to help with this? As you can probably tell, I've no experience with VBA, Macros or even Visio until this week! Thanks |
#2
|
||||
|
||||
Assuming you have used the OrgChart template to create your orgchart, there is a button on the OrgChart tab to do exactly this. You can use the keyboard shortcut Alt-O,U to run it.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Yeah, that's exactly behaviour I'd like, but on double click so that it's user friendly.
Essentially I've, say, 256 Visio Floor Plans for different scenarios, and I'd like to use an organisation chart to help others select the correct one. Then first level of the chart is 4 options City A - City B - City C - City D On double click, this opens up 4 more options for space Small - Medium - Large - Jumbo On double click this opens up 4 more options Seating A - Seating B - Seating C - Seating D and so on. On the last layer, the Shape is a link which leads to a Visio Floor plan. I'm using the "behaviour" on double click option to run a macro and expand the subordinates. This works fine, but if the user selects the wrong option and needs to go back they can't do it on double click as the macro only expands. The page then gets over-crowded and overlaps happen etc. Hoping to make this completely intuitive. Thanks again |
#4
|
||||
|
||||
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 |
Tags |
vba visio macro |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Double click on a cell to add check mark? | robbinskelly7 | Excel | 1 | 02-09-2015 07:05 PM |
Excel Files Won't Open With Double Click | ykhalil | Office | 1 | 11-10-2014 05:00 AM |
Play Shockwave on a double click | dedine | PowerPoint | 4 | 06-03-2013 08:26 AM |
Drop-Down Menu, show-hide, expand-collapse??? | 300zxmuro | Word | 1 | 02-27-2011 03:02 PM |
Cannot Double Click on Microsoft Word Document | weeleong87 | Word | 0 | 07-19-2009 05:54 AM |