Displaying Inches as Fractions

I was recently asked if the Size & Position Window in Visio can display fractions of inches as fractions rather than as decimals.  Well, most people are aware than you can type fractions into the Size & Position Window, but it is immediately translated into decimals, and I cannot find any way to keep the display as fractions, however you can link Shape Data (nee Custom Properties) to the width and height.

In the image below, I have added two Shape Data rows (Prop.Width and Prop.Height) and I have linked the values of the rows to the shape’s Width and Heights with the formulae =SETATREF(Width) and =SETATREF(Height).

image

These formulae mean that any values typed into the Shape Data Window are immediately re-directed to the shape’s Width and Height cells, and the format picture ="# ##/## u" ensures that the values are displayed as fractions.

Moreover, values can be typed into either the Size & Position Window or the Shape Data Window.

In the above example, I also chose to display the Width and Height values in the text of the shape using the FIELDPICTURE(18), which displays the result as fractions.

P.S.  I’m old enough to remember Feet and Inches being called Imperial Units … it’s a sign of the times that they are now called US Units!

Visio Viewer Developer Reference Released

Following on from my blog about the Microsoft Visio Viewer, I am delighted that Microsoft have published a developer reference for it (long overdue, but very welcome).  See the MSDN pages at http://msdn.microsoft.com/en-us/library/cc297217.aspx and Visio Insight blg http://blogs.msdn.com/visio/archive/2009/01/14/developer-reference-for-visio-2007-viewer-released.aspx

Turning OFF The Cross Functional Flowchart Addon in Visio

Following on from my last blog, my colleague also needs to stop the Cross Functional Flowchart behaviour in a Visio Diagram.  Well, I was almost fooled again into thinking that it might be as simple as removing the Persistent Events using the tool in the Visio SDK.

image

Well, deleting them was no problem, but the DocumentOpened event was re-added as soon as the document was saved.  A little investigation revealed that there are 56 EventList items in a Cross Functional Flowchart diagram (after deleting the two PersistentEvents), but only 44 in a standard Visio document (on my Visio 2007 Pro installation).  So, there are an extra 12 that have been added … just ready to spring back into life when the actions they are listening to are fired.  One of these must be the DocumentSaved event, so simply disabling the events before saving (and remembering to switch them back on), allowed me to remove the Cross Functional Flowchart add-on.

One caveat, dragging a Functional band master back onto a page will switch it back on again.

Public Sub RemoveCFF()
Dim evt As Visio.Event
Dim i As Integer
    For i = Visio.ActiveDocument.EventList.Count To 1 Step -1
        Set evt = Visio.ActiveDocument.EventList.Item(i)
       If evt.Persistent = True Then
            If evt.Target = "CFF"
Then
                Debug.Print evt.Target
                evt.Delete
           
End If
        End If
    Next

    On Error Resume Next
    Visio.Application.EventsEnabled = 0
    Visio.ActiveDocument.Save
    Visio.Application.EventsEnabled = -1
End Sub

Follow

Get every new post delivered to your Inbox.

Join 184 other followers