Readers of my blog will know that I often customize Visio masters, but I rarely bother to (re-)set the keywords or copyright. The reason being that I do not like to change the copyright if it has been set by another, and I was not quite sure where the keywords were stored. So, I decided to document them both here for my (and your) future use!
The Keywords textbox on the Master Properties dialog provides you with the opportunity to enter keywords for the master which can be used by the Search function:
However, if you look at the properties of the Master object, you will not find a Keywords property:
This is because these keywords are not stored against the master object, but are actually stored in a cell, called ShapeKeywords, in the page of the Master!
Try it for yourself by typing something like the following in the Immediate Window:
This cell does not appear in the ShapeSheet window…
I was always taught that the Copyright is a write once operation, and indeed that is true if you try to automate it. If you look at the the master shape of a Microsoft supplied master, then you will find the Copyright is read-only:
If you draw your own shapes, then the copyright cell is available to edit … until you save it!
It is indeed a write once cell, because the next time you open the Shape Name dialog, the Copyright textbox will be greyed out.
In the VBA Immediate Window, you get read the copyright like this:
Here is my own copyright message!
But, if you then tried to overwrite it, you will get an error message:
Visio.ActiveWindow.Selection.PrimaryItem.Cells("Copyright").Formula = "=""Oops, I meant to write this!"""
Not surprisingly, this cell does not appear in the ShapeSheet window either…
Hiding Information in your Pages
So, knowing that the ShapeKeywords cell is in the PageSheet of a Master, then it follows that it exists in every page. It is perhaps more surprising that the Copyright cell also exists in every page.
Therefore we have two hidden cells that you can address in the ShapeSheet, as in this example Shape Data section:
You could set the ShapeKeywords cell value in code:
Visio.ActivePage.PageSheet.Cells("ShapeKeywords").Formula = "=""Be smart, be clear, BE VISUAL"""
Visio.ActivePage.PageSheet.Cells("Copyright").Formula = "=""bVisual ltd"""
Then, any shape can read the values:
It can get a bit tedious to do that an every page, so you could put a SETF() formula into the EventDrop cell of a shape:
There is no error if the Copyright cell is written to again … it just fails. Therefore the first set of the page Copyright cell wins.
The ShapeKeywords cell, on the other hand, can be written to many times.
I am not sure what use I will put this knowledge too, but I thought I would write them down for others to ponder….
Printing question. How do we get VISIO to remember the printer and printing settings for large format drawings?
Default printer: Xerox WorkCenter 7545 PS
Specialty printer: RICHO Aficio MP W3601 PS
.. Roll fed. Must be 36″ wide or the print job will be rejected. (ex. A 34″ wide print will be rejected)
.. Either 36″x48″ or 36″x24″
A large format 36″x48″ drawing.
VISIO does not remember the printer needed for the large format drawing.
When the file is opened, the selected printer will be the last printer used (typically the 8.5×11″ default printer).
This means that the printer settings have to be reset each time.
There does not seem to be an option to select a printer via “Page Setup”.
The page size options available are only those available on the currently selected printer.
To switch to the correct printer, it seems that I have to initiate a “Print”, select the printer, and then a “Close”.
I then have to go through the effort of resetting the ‘Page Settings’ because some of the settings invariably seem to have been changed.
It seems that I should be able to specify the printer I want to use for a particular specialty drawing and have VISIO remember those settings for the next time I edit that drawing.
This seems to be the same question:
Does the “Maps and Floor Plans” / “Building Plan” / “resources” / Printer shape you talked about resolve this issue if it is dropped into a drawing.