There are literally thousands of master shapes in the stencils supplied with Microsoft Visio, so I guess that mistakes can creep in. One error that I have noticed is the inability of the default text control handle of many of the network shapes to actually move the text block horizontally.
It moves the vertical position without a problem, as can be seen in this short video:
The fix is straight forward enough. The TxtPinX cell is missing the formula =SETATREF(Controls.visSSTXT) , so this following VBA macro can fix that for an active document. It will need to be run after the problem master shapes have been first used in the document, but then they are fixed for ever….
Public Sub FixTheTextControlHandle()
On Error GoTo errHandler
Dim mst As Visio.Master
Dim mstCopy As Visio.Master
Dim shp As Visio.Shape
Dim curFormula As String
'This is the referenced cell
Const cll As String = "Controls.visSSTXT"
'This is the missing formula
Const frml As String = "SETATREF(Controls.visSSTXT)"
For Each mst In ActiveDocument.Masters
If mst.Shapes(1).CellExistsU(cll, Visio.VisExistsFlags.visExistsAnywhere) <> 0 Then
curFormula = UCase(mst.Shapes(1).CellsU(cll).FormulaU)
If Not UcurFormula = UCase(frml) And _
Not InStr(curFormula, "GUARD") > 0 Then
Set mstCopy = mst.Open
Set shp = mstCopy.Shapes(1)
shp.CellsU("TxtPinX").FormulaForceU = "=" & frml
mst.MatchByName = True
MsgBox Err.description, vbExclamation, "FixTheTextControlHandle"
Then the control handle can move the text block horizontally too:
I have informed Microsoft of the bug, and hope they will fix it soon.
I recently had to revise my understanding of the POINTALONGPATH(…) function in Visio because I was getting a #REF! error in some cases. My particular scenario requires a line with a number of vertices that are initially all in a straight line but can be moved by dragging controls around that each vertex is bound…
I was recently looking into custom color themes for corporate branding in desktop Microsoft Visio and became re-aware how different Visio still is from the rest of the Microsoft Office applications. A Visio page or document does not need to have any theme applied, but the documents of the other Office applications always have a…
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…
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…
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…
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…