… that is the question!
I have known for some time that it is safer to copy and paste code from the web into Notepad or similar, before copying and pasting that into my own code. It is not only new line characters that can be different but also the double-quotes. I recently noticed this when I was writing my series on Visio ShapeSheet Functions A-Z because I make copious use of the EVALTEXT(…) function, so I investigated further and found that there are different double-quotes used when typing text into a Visio shape or typing into a Visio ShapeSheet cell!
I used the Immediate Window in the VB Editor to get the Ascii numbers for the three different double-quote characters:

The ShapeSheet formulas that I used with Insert / Field / Custom Formula on the three callouts associated with the ellipse shape containing “”” are:
="The first character of the target shape evaluates to : "&IFERROR(LEFT(SHAPETEXT(CALLOUTTARGETREF()!TheText),1),"#NA")
="The second character of the target shape evaluates to : "&IFERROR(MID(SHAPETEXT(CALLOUTTARGETREF()!TheText),2,1),"#NA")
="The last character of the target shape evaluates to : "&IFERROR(RIGHT(SHAPETEXT(CALLOUTTARGETREF()!TheText),1),"#NA")
I discussed these findings with fellow Visio MVP, John Goldsmith, who pointed out that Visio is using a Word feature to auto-format as you type, and this can be unticked in Visio Options / Proofing / AutoFormat As You Type / Replace as you type / “Straight quotes” with “smart quotes”.

This does work, or, alternatively, you can hit CTRL-Z immediately after typing a double-quote character because the straight quote is inserted first, and then followed by the AutoFormat replacing it with a smart quote.
When is a Visio Callout not a Callout?
I have been a Visio user/developer since the mid-1990’s and seen the word “callout” used as part of the name of many master shapes in Visio. The images below show five ways that the term “callout” has been applied to the name of Visio master shapes. Generally, each evolution has been an advance on the…
Using Visio Color by Value on Connectors
Data Graphics in Visio Plan 2 and Visio Professional is great, but it only enables us to use them with 2D shapes in Visio, i.e. not on connectors. So, what if you want to change the line colour of the connectors between the 2D shapes because of the data flowing between them? Well, it is…
Using Notepad++ to Edit Visio ShapeSheet formulas
Visio shapes get their smartness from the formulas that are entered into the ShapeSheet, but editing these formulas can be extremely tricky and prone to error because of the lack of a modern programmer’s interface. Formulas can be quite long (up to 64k characters) but even medium size ones like the one in User.GetWorkdays cell…
Adding a second Function header bar to Visio swimlanes
I was recently asked if a second function header bar can be added to the swimlanes in the cross-functional flowchart templates in Visio. Some swimlanes can get quite wide, so it can be useful to have a duplicate function header shape on the far-side too. It is quite simple to duplicate the existing function header…
More Parsing XML Data in Visio Shapes
My last article looked at parsing an XML string with a known structure and order of elements and attributes. This can be acceptable in some scenarios, but what if the elements or attributes are in a different order? Then it is necessary to use the element and attribute names rather than their index position. This…
Parsing XML data in Visio Shapes
One of my current projects uses XML data, and some of the values in the XML data control the display and content of Visio shapes. Therefore, I looked deeper into how the XML data can be used directly to control parts of the graphics. Although the external data linking feature in Visio Professional and Visio…
Leave a Reply