Visio has had a Number Shapes add-on for many years, even since before Microsoft bought the application in 2000. The add-on autmatically creates three Shape Data rows to hold the number, any prefix text, and a value to indicate whether the shape number text should be shown. It is useful, but it can also be very annoying if you also want to label your shapes, such as with process flow shapes, or you want the shape number to be displayed outside of the main shape. Fortunately, there is a solution….
The View / Macros / Add-Ons / Visio Extras / Number Shapes… tool will provide the General options to set which shapes should be numbered, and with what. The Advanced tab has more options such as the direction of auto numbering, the position of the shape number relative to the shape text. The Hide shape numbers option should be ticked because we want to display it outside the shape.
The solution is to use the Data Graphic capabilities of Visio Professional and Visio Online Plan 2.
Now create a new Data Graphic, add a New Item and choose the More Fields... option at the bottom of the Data field drop-down list. Then select the Custom Fomula Category and enter:
={Shape Number Text}&{Shape Number}
Then choose a suitable Text Callout, such as the Circle callout, and edit the values to suit. Then apply this to all of the shapes that have been numbered.
The shape number is displayed, but there is an annoying empty line where the hidden shape number is.
So, we need to add an extra Text Callout Data Graphic item to display the shapes’s text, but to remove the surplus carriage return and line feed characters.
So, edit the existing Data Graphic, select New Item and choose another More Fields…. This time, enter the following Custom Formula:
=SUBSTITUTE(SHAPETEXT(TheText),CHAR(13)&CHAR(10),"")
This will remove the new line characters and display the text as desired. Ensure that the Hide shape text when data graphic is applied option is ticked.
You can still edit the text of the shapes, and you can number or renumber them, as required.