Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-26-2019, 03:52 PM
Lambo Lambo is offline Expand/Hide Subordinates with double click Windows 7 32bit Expand/Hide Subordinates with double click Office 2010
Novice
Expand/Hide Subordinates with double click
 
Join Date: Mar 2019
Posts: 2
Lambo is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 04-01-2019, 11:09 PM
Guessed's Avatar
Guessed Guessed is offline Expand/Hide Subordinates with double click Windows 10 Expand/Hide Subordinates with double click 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

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
Reply With Quote
  #3  
Old 04-02-2019, 03:47 AM
Lambo Lambo is offline Expand/Hide Subordinates with double click Windows 7 32bit Expand/Hide Subordinates with double click Office 2010
Novice
Expand/Hide Subordinates with double click
 
Join Date: Mar 2019
Posts: 2
Lambo is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 04-02-2019, 09:13 PM
Guessed's Avatar
Guessed Guessed is offline Expand/Hide Subordinates with double click Windows 10 Expand/Hide Subordinates with double click 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
Reply

Tags
vba visio macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expand/Hide Subordinates with double click Double click on a cell to add check mark? robbinskelly7 Excel 1 02-09-2015 07:05 PM
Expand/Hide Subordinates with double click 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
Expand/Hide Subordinates with double click 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft