Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-24-2018, 06:34 AM
R Mohan R Mohan is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 8 Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Novice
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy
 
Join Date: Apr 2018
Posts: 15
R Mohan is on a distinguished road
Default Smart Art Org Chart - Is it possible to give a custom RGB color for each level within the hiearchy

Hi Guys !



I was wondering whether its possible to use VBA to give a specific color to each level of the org chart (smart art) hierarchy. I know this can be done by editing the slide master, but my current requirement is to do it via VBA.

Awaiting your help !
Reply With Quote
  #2  
Old 04-24-2018, 08:10 AM
JohnWilson JohnWilson is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 7 64bit Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

If you loop through .AllNodes in a SmartArt Hierarchy you can check the level of each node and fill accordingly.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 04-24-2018, 08:47 AM
R Mohan R Mohan is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 8 Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Novice
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy
 
Join Date: Apr 2018
Posts: 15
R Mohan is on a distinguished road
Talking

Hi John,

I am still learning VBA, and coding this would be a bit tough for me. Therefore, I might need your expert advise to apply the below patterns for levels via VBA to my org chart.

Level 1 (The head) - Blue
Level 2 - Green
Level 3 - Purple
Level 4 - Yellow
Level 5 - Orange
Level 6 - Grey
Level 7- Magenta
Level 8 - Violet

Awaiting your help.
Reply With Quote
  #4  
Old 04-24-2018, 10:13 AM
JohnWilson JohnWilson is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 7 64bit Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Here is how to start (then it's up to you)

Code:
Sub SA_col()
Dim oSA As SmartArt
Dim L As Long
'smart art must be selected!
Set oSA = ActiveWindow.Selection.ShapeRange(1).SmartArt
For L = 1 To oSA.AllNodes.Count
Select Case oSA.AllNodes(L).Level
Case Is = 1
oSA.AllNodes(L).Shapes(1).Fill.ForeColor.RGB = RGB(0, 0, 255) 'blue
Case Is = 2
oSA.AllNodes(L).Shapes(1).Fill.ForeColor.RGB = RGB(0, 255, 0) 'green
'etc for other levels
End Select
Next L
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #5  
Old 04-24-2018, 12:07 PM
R Mohan R Mohan is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 8 Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Novice
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy
 
Join Date: Apr 2018
Posts: 15
R Mohan is on a distinguished road
Thumbs up Thank you very much

Hi John,

I just want to personally thank you for solving my issue.

Brilliant piece of code !

Its been a great help to me !
Reply With Quote
  #6  
Old 04-25-2018, 07:02 AM
R Mohan R Mohan is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 8 Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Novice
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy
 
Join Date: Apr 2018
Posts: 15
R Mohan is on a distinguished road
Default Connector colors are not changing

Hi John,

Thank you for your help thus far !

I just happened to noticed something, and I might need your advise to resolve this.

Whilst the smart art node colors are changing accurately(based on levels), the connectors are still retaining the former colors.

Would you be able to suggest how this too can be accomplished via the same code.

Thanks a ton !
Reply With Quote
  #7  
Old 04-25-2018, 07:16 AM
JohnWilson JohnWilson is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 7 64bit Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

AFAIK there's no way to do that in code.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #8  
Old 04-30-2018, 06:37 AM
R Mohan R Mohan is offline Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Windows 8 Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Office 2016
Novice
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy
 
Join Date: Apr 2018
Posts: 15
R Mohan is on a distinguished road
Default Thank you John

Hi John,

Sorry for the delayed response.

Just want to thank you for all your help.

Appreciate it !!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Smart Art - Updating a Chart AD1983 PowerPoint 2 10-18-2016 06:26 AM
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Can I select the entire second or third level in an org. chart? blockie Word 1 08-25-2014 11:19 PM
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy I created a custom XML color scheme. How do I add that to the Built-in Color? Cassik PowerPoint 5 11-04-2013 02:08 PM
Custom colors for smart art - via template? theme? add-on? fl8rmaus PowerPoint 0 09-26-2012 08:10 AM
Smart Art Org Chart -  Is it possible to give a custom RGB color for each level within the hiearchy Custom field formula not working at summary task level abw1987 Project 3 10-05-2011 07:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:00 AM.


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