I have only been developing Visio solutions for 25 years, but I got a surprise this week when I was trying to understand why I couldn’t update the value of a Shape Data row of multiple selected shapes. It is something that I often do, so it took me a while to understand why I was failing to change the values, even though it appeared to initially change in the Shape Data window. There was no problem selecting the shapes individually, but every time I selected multiple shapes and edited these particular rows, I could see the new value in the Shape Data window, but as soon as I looked at the individual shapes, I could see that the values never got changed. I checked my code in vain, and ran the Events Monitor from the Visio SDK. Visio seemed to enter the Shape Data scope, but then immediately exited it without attempting to apply the new value to the shapes. Very strange![Read more…] about Using a formula for Shape Data labels prevents multiple updates
I was going to title this “When is a truth not a truth?” because I have found that Visio can sometimes refuse to apparently update the displayed value in a cell, even though it has been changed. However, this was, in this instance, down to a misunderstanding of the formula evaluation events on my part. Take the scenario where you have some data that you want to be available to all pages and all shapes in the Visio document. There are some built-in Document Properties in Visio that are accessible to all pages and shapes using ShapeSheet functions ( eg TITLE(), SUBJECT(), COMPANY(), Categories / CATEGORY(), Tags / KEYWORDS(), Comments / DESCRIPTION(), Author / CREATOR(), MANAGER() and HYPERLINKBASE()). However, Visio does not have custom Document Properties like the other Office applications. Instead, Visio allows for the addition of User-Defined Cells and Shape Data rows in the DocumentSheet of the document. These can be uniquely named, and Shape Data rows can be given a data type (of sorts), a label, prompt and format.
These values can be accessed via a ShapeSheet function from anywhere within the document, which ensures that you only have one version of the truth. However, there is no non-developer user-interface to edit these DocumentSheet Shape Data values in Visio, so what do you do? And how can you be sure that you are always seeing these centralised values correctly?
I created the following master shape to test how this can be done. It is a group shape that contains a single StartDate Shape Data row, which is used to edit or view the date in the similarly named Shape Data row in the DocumentSheet. For good measure, I also added a similarly named Shape Data row to the page, so the Shape Data window in the page could also be used. I then used Insert / Field to display the values in the ShapeSheet, PageSheet and DocumentSheet:[Read more…] about Forcing Display Update of Inherited Data Values
A reader asked how to fill a shape with a custom fill pattern from a fixed list in of a shape. They had no trouble with the first 25 standard fill patterns, but couldn’t figure out how to apply a custom pattern. So, I shall try to explain how this can be done …[Read more…] about Using Custom Fill Patterns from a List
Many years ago, I wrote some VBA code to calculate the length of a multi-segment line in Visio, see Automating Area and Perimeter Length Shape Data , but Microsoft have since provided a handy ShapeSheet function, PATHLENGTH(…), to do the same without any VBA. The function is described on one of the pages in Visio ShapeSheet Functions O-R , but here is one way that it can be incorporated into a useful shape for, say, cabling or piping, and thus be available in Shape Reports. Moreover, the Shape Data can display the length of each of the segments in the line, in addition to the total length.[Read more…] about Automatic Line and Segment Lengths in Visio
There are times that I have been caught out by assuming that everyone speaks “proper” English, like what I do (sic), and forgetting that there are other languages with their own formatting conventions. I think most of the world is bemused at the USA date format where they put the month before the day and the year. So illogical to everyone else, and I can’t help thinking that it was done on purpose just to catch us Brits out, like when they decided to drive on the wrong side of the road just to make it more difficult to sell cars across the border. It seems that some parts of Visio get confused if I enter the dates in the correct “dd/mm/yyyy” format, so I now type dates in the “d mmm yyyy” format in the Shape Data window calendar control because, at least, that always works. Also Visio‘s internal units are inches, and every time I see it referred to as US Units, rather than the Imperial Units that I grew up with, makes me think “so, this is what it has come to!”.
So today I was embarrassed by a Norwegian client because I forgot (again) to take extra care when using the RGB(…) function. The result was that the displayed colours were appearing black in Norwegian (and doubtless many other languages), but correctly grey (gray if you are in the USA), blue, green and yellow in English (both UK and US).[Read more…] about Testing Regional Settings in Visio
Back in 2012, my fellow Visio MVPs, Scott Helmers and Chris Roth, and I recorded a series of 24 videos about Visio 2010. They were first hosted on Microsoft’s web site, then they put them up on YouTube, they they got deleted :-(. Well, we have managed to retrieve them, and put them back up on YouTube in a new list :-). Most of them are still very relevant and useful!