Solved

Hiding Shape Data on Organizational Chart WebPage Publication

Posted on 2010-09-13
14
2,047 Views
Last Modified: 2012-05-10
I currently have an Org. Chart that is driven off an excel sheet employee database.

I like that all the columns I have in excel display as shape data, however for a "save as webpage" version I would like some of that shape data not to be included; can I hide/unhide certain shape data for the creation of various web-based versions?

Also how do I change the order of shape data so it displays more logically?
0
Comment
Question by:-Polak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 33669276
Polak,

Here's a tutorial that might help you get what you need.

http://www.visguy.com/2006/09/05/the-hidden-world-of-visio-shapes/

Sincerely,

Ed
0
 
LVL 1

Author Comment

by:-Polak
ID: 33673120
I don't think that helps, when I got into the ShapeSheet the only "layers" in there are "Hidden" and "DataGraphic".

All the shapes are auto-linked to an external excel sheet.
0
 
LVL 1

Author Comment

by:-Polak
ID: 33674028
Anybody?
0
Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

 
LVL 30

Expert Comment

by:Scott Helmers
ID: 33675237
Are you trying to hide some of the data that appears on the shapes in the org chart? Or are you trying to hide the shape data that appears in the Details pane on the left side of the web-published page?
0
 
LVL 1

Author Comment

by:-Polak
ID: 33675388
Both. Only 3 fields appear on the physical shape, need 1 of the 3 hidden.
And in shape data I need 7 or so hidden.
0
 
LVL 1

Author Comment

by:-Polak
ID: 33675551
I figured out the on shape displyed data, under Organization Chart>Options>Fields tab.
Now i'm concerned with the right-pane stuff.
0
 
LVL 30

Accepted Solution

by:
Scott Helmers earned 500 total points
ID: 33675961
OK. Each shape data field has an "invisible" attribute. (Unfortunately, this attribute is called "invisible" in the shapesheet, but is called "Hidden" in the user interface. I realize they mean the same thing but it would be nice if Microsoft used consistent terminology!)

To set the invisible attribute, right-click on a shape and select Data>Shape Data, then click the Define button. Select the attribute you want to hide, and add a check to the box labeled "Hidden". Repeat for additional fields.

f this is something you want to do occasionally, I would recommend that you use the macro recorder to record two marcos: one to hide the required fields and one to unhide them. Or if you prefer to write VBA code yourself, you can use the macro recorder as a guide and then write code to accomplish the same thing. However, the macro recorder may do the trick.

Here's a very useful trick: if you select multiple shapes before  selecting Data>Shape, then the changes you make in the shape data  dialog will be applied to all selected shapes. The macro recorder handles changes to multiple shapes properly as well. However, it only does so on a single page at a time. If you want to apply the same changes to multiple shapes on multiple pages, you will need to write some code.
 
 IRegards,
Scott
 
0
 
LVL 1

Author Comment

by:-Polak
ID: 33676200
"and add a check to the box labeled "Hidden". "
I don't see a check box for this?
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 33676682
The Define dialog should look like the image below...

Hidden.jpg
0
 
LVL 1

Author Comment

by:-Polak
ID: 33677345
Hummmm..... ???!?!?!?!
shapedata.JPG
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 33682888
???!?!?!?! indeed! I don't know why you don't see those options...

I guess that means we'll need to do the equivalent function directly in the shapesheet instead of through the shape data dialog, and it also means that it will be easiest to do it in VBA code. See below -- one macro to hide fields and one to reveal them.

You'll just need to substitute the field names as appropriate (note that you need to change the field name in two places  for each field). I'm altering two fields -- "Telephone" and "Email" -- in my sample code.

Sub HideShapeDataFields()
' hides selected shape data fields on all pages

    Dim pg As Page
    Dim shp As Shape
    
    For Each pg In ActiveDocument.Pages
        For Each shp In pg.Shapes
            If shp.CellExists("Prop.Telephone", False) Then
                shp.Cells("Prop.Telephone.Invisible").Formula = True
            End If
            If shp.CellExists("Prop.Email", False) Then
                shp.Cells("Prop.Email.Invisible").Formula = True
            End If
        Next
    Next

End Sub
Sub ShowShapeDataFields()
' shows selected shape data fields on all pages

    Dim pg As Page
    Dim shp As Shape
    
    For Each pg In ActiveDocument.Pages
        For Each shp In pg.Shapes
            If shp.CellExists("Prop.Telephone", False) Then
                shp.Cells("Prop.Telephone.Invisible").Formula = False
            End If
            If shp.CellExists("Prop.Email", False) Then
                shp.Cells("Prop.Email.Invisible").Formula = False
            End If
        Next
    Next

End Sub

Open in new window

0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 33682924
No sooner had I posted the above when I figured out why you don't see the two options in the Define Shape Data dialog -- they only appear if you are running Visio in "developer" mode.

To turn on developer mode, select Tools>Options, then click the Advanced tab and place a checkmark next to Run in developer mode.
0
 
LVL 1

Author Comment

by:-Polak
ID: 33685158
Okay that worked. How about the logical order of the shape data can that be modified?
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 33685502
Also easy to do in the shapesheet...

If you want to reorder fields in an existing drawing, use the code below (note the field attribute of "SortKey" instead of "Invisible").

If you want to change the master in the stencil so that all future instances show data in your desired sequence, that requires a bit more work and is worthy of at least one additional question.

Scott

Sub ReorderShapeDataFields()
' change sort sequence for selected shape data fields on all pages

    Dim pg As Page
    Dim shp As Shape
    
    For Each pg In ActiveDocument.Pages
        For Each shp In pg.Shapes
            If shp.CellExists("Prop.Telephone", False) Then
                shp.Cells("Prop.Telephone.SortKey").Formula = 1
            End If
            If shp.CellExists("Prop.Email", False) Then
                shp.Cells("Prop.Email.SortKey").Formula = 2
            End If
        Next
    Next

End Sub

Open in new window

0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scott A. Helmers Partner, Harvard Computing Group Microsoft Visio MVP Background Microsoft has added more enhancements and new features to Visio 2010 than to any release since they purchased the Visio product line in 2000. In addition, the com…
Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question