I'm a newbie so if I'm posting this in the wrong place, please forgive me. I created a couple of interactive maps using Visio (not sure what version) and saved them as HTML to post on our portal. I was recently given a new laptop with Visio 2007 and have realized that it is an upgrade from what I was using previously and that Custom Properties is now something like Shape Data. In the old version each image had a unique identifier called a Shape Name. I copied and pasted many of the images and edited them in the new Visio 2007 only to find out that I couldn't change the unique identifier any longer! Now I have images appearing with names they shouldn't have. How can I change a Shape Name in the new Visio 2007?

Dani AI

Generated

Short summary: the fix shown by is correct — the Shape Name (formerly Special) dialog is hidden by default in Visio 2007 and appears once Developer Mode is enabled. That dialog is the UI place to edit a shape's Name property so exported HTML or scripts refer to the name you expect. . ()

Other ways to view or edit a shape's name (useful if you have many shapes or are on a newer Visio): in Visio 2010+ the Shape Name dialog lives on the Developer tab (Shape Design → Shape Name); the Drawing Explorer window lets you rename items with F2 and select shapes by name; and the ShapeSheet is the place to see/set name and shape-sheet cells programmatically. See the Developer-tab notes and Drawing Explorer / ShapeSheet docs for details. . Drawing Explorer instructions. Open the ShapeSheet. ()

Practical tips and cautions: a shape's NameID (sheet.n) is unique only within its page or master and can be reused later, so prefer predictable names if your workflow depends on them — or persist the shape UniqueID if you need a globally stable identifier. When copying lots of shapes, rename them in bulk rather than manually to avoid collisions; grouped shapes have scope rules (a subshape name is scoped inside its group), so cross-shape references sometimes require Sheet.ID syntax. Shape.NameID reference (notes on uniqueness and reuse). (learn.microsoft.com)

Tiny VBA helper — rename every shape on the active page using a safe prefix plus the shape ID (run from the Visio VBA editor):

Sub RenameShapesRecursive(shps As Visio.Shapes, prefix As String)
    Dim shp As Visio.Shape
    For Each shp In shps
        On Error Resume Next
        shp.Name = prefix & shp.ID
        On Error GoTo 0
        If shp.Shapes.Count > 0 Then RenameShapesRecursive shp.Shapes, prefix
    Next shp
End Sub

Sub RenameAllShapesOnPage()
    RenameShapesRecursive Visio.ActivePage.Shapes, "MapShape_"
End Sub

Notes: enable Developer Mode to access the ShapeSheet or Drawing Explorer before running macros. This thread resolved 's original problem; also pointed out an add-in for automatic layout (Graphvizio) for larger diagram workflows.

Recommended Answers

All 3 Replies

Hey Hollyjean,

Don't worry, your problem is easily solved! And something did change with Visio 2007!

To access the dialog where you can see and edit a shape's name, you use the Special dialog, located under the Format > Special menus.

In Visio 2007, this menu has been hidden unless you are running in Developer Mode. This sounds ominous, but it's just a matter of a simple check box:

Go to Tools > Options. On the Advanced tab, notice the check box up at the top named Run in Developer Mode. Simply check this item and the Special dialog will be accessible!

If you're doing web-site layout with Visio, you might be interested in a few other articles on my Visio Guy web-site:

Pixel Unit Dimension Line Shape
Lorem Ipsum – Visio IA Text Placeholder Shape


Chris
Visio Guy
http://www.visguy.com


I'm a newbie so if I'm posting this in the wrong place, please forgive me. I created a couple of interactive maps using Visio (not sure what version) and saved them as HTML to post on our portal. I was recently given a new laptop with Visio 2007 and have realized that it is an upgrade from what I was using previously and that Custom Properties is now something like Shape Data. In the old version each image had a unique identifier called a Shape Name. I copied and pasted many of the images and edited them in the new Visio 2007 only to find out that I couldn't change the unique identifier any longer! Now I have images appearing with names they shouldn't have. How can I change a Shape Name in the new Visio 2007?

Thank you VisioGuy! That worked!! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.