• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2327
  • Last Modified:

Hiding Shape Data on Organizational Chart WebPage Publication

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
-Polak
Asked:
-Polak
  • 7
  • 6
1 Solution
 
MINDSUPERBCommented:
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
 
-PolakAuthor Commented:
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
 
-PolakAuthor Commented:
Anybody?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
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
 
-PolakAuthor Commented:
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
 
-PolakAuthor Commented:
I figured out the on shape displyed data, under Organization Chart>Options>Fields tab.
Now i'm concerned with the right-pane stuff.
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
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
 
-PolakAuthor Commented:
"and add a check to the box labeled "Hidden". "
I don't see a check box for this?
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
The Define dialog should look like the image below...

Hidden.jpg
0
 
-PolakAuthor Commented:
Hummmm..... ???!?!?!?!
shapedata.JPG
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
???!?!?!?! 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
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
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
 
-PolakAuthor Commented:
Okay that worked. How about the logical order of the shape data can that be modified?
0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now