Jump to Any Page With Visio SmartShapes
Visio SmartShapes don’t aren’t just for enhancing your Visio diagrams. They can be put to work as tools too!
Find out how such a Shape Tool can help you navigate multi-page Visio documents with ease!
Many Pages Hard to Navigate
If you have Visio documents with lots of pages, you know that navigating via page tabs is less than ideal.
Sure, the page tabs have the forward, back, fast forward and rewind buttons, but if you have 15 pages or more, getting to the ones in the middle will require a bunch of annoying clicks. And if you have to jump a lot, this gets old quickly.
Menus help a little. Edit > Go To shows you a list of pages in a cascading sub-menu. But only up to eight. If you have more pages than that, you’ll have to fire up a dialog using the Page… option at the end of the Go To menu. where you can choose from a nifty list of all pages in your document:
This works well, but you still have to dig into two levels of menus every time you want to navigate. In Visio 2010, you’ll have to customize the ribbon before the Go To command is even available to you!
The Drawing Explorer window can also help you out:
When you click on a page node, the corresponding page is immediately shown in the drawing window. But it too quickly runs out of space and requires scrolling. Plus, you lose a bunch of screen real-estate by having this window displayed. Not a good use of the your Visio window if you’re using the explorer just for jumping pages. In Visio 2010, the Document Explorer is hard to find. It requires the Developer tab to be visible, which requires a trip to the Backstage area to customize the ribbon.
Use SmartShapes as Tools
In dealing with these shortcomings for a customer, I came up with an odd technique that is simple and effective.
I created a Visio SmartShape that acts as a tool. Just a simple shape that functions as a button to quickly get you to the Page dialog. The shape isn’t intended to be part of the diagram, but just a shortcut or button that can be placed on any or all pages, in any location. The shape could just be a simple rectangle, but I like to make it look a bit fancier, and more button-like. Here’s one I’ve created:
To make the shape work, we need to add a few ShapeSheet functions to it. Mainly, we’ll use the DOCMD function to invoke the Page dialog.
It turns out that DOCM(1077) calls up the Page dialog, and we hook this function up to the double-click event for the shape. Here’s a run-down of the ShapeSheet cells that I edited for my page-jumping shape:
In the Events section:
EventDblClick = DOCMD(1077)
Now a double-click will pop-up the Page dialog. Super simple!
In the Miscellaneous section:
Comment =”Double-click to jump to a page in this document by choosing from a pop-up list of pages.”
With NonPrinting set to TRUE, the shape won’t print, and our diagrams will stay clean. Now you can leave the button shape laying around wherever you want without worrying about it messing up any of your published output!
The Comment cell shows us a ScreenTip when we hover the mouse over the shape:
You can also set comments inserting a ScreenTip from the Insert menu, but since we were already in the ShapeSheet…
Now when we double-click the shape, we’ll immediately see the Page dialog:
Where we can double-click one of the pages in the list and immediately jump to it!
One other question my customer had was: “How do I make a shape that link to the last page visited?” She wanted the equivalent of the “back” functionality that you commonly find in browsers. Visio did at have some browser-like buttons at one time, and you can still find a Back function in the list of commands available for ribbon customization in Visio 2010. However, Back doesn’t work if you use the Page dialog to navigate. It only works if you jumped to a page using a hyperlink.
There are likely corresponding DOCMDs for Forward and Back available, so perhaps a system of “Shape Tools” could be built that allow page navigation plus forward and back behavior. If anybody figures it out, please leave a comment below telling us what you’ve found out!