• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Visio Guy

Smart graphics for visual people




  • Home
  • Hire Me
    • Hire Me
    • Résumé
  • Products
    • Products
    • Bubble Revision Shape
    • Layers to Pages Utility
    • Rack Unit Dimension Line
    • Radial Elements Tool with up to 100 Wedges
    • Text on a Circle Visio SmartShape
  • Index
    • Articles by Date
    • YouTube – VisioGuy
    • Download Information
    • Suggestion Box
    • Shop
    • Visio Art
    • Visio Links
    • – Visio Shapes & Stencils
    • – Visio Templates & Drawings
  • About
    • About
    • Donate
    • GitHub
    • jsFiddle
    • Reading List
    • Subscribe & Follow
      • – E-mail
      • – facebook
      • – Twitter
      • – RSS
    • Privacy Policy
  • Discussion Forum
You are here: Home / Power User / Jump to Any Page With Visio SmartShapes

Jump to Any Page With Visio SmartShapes

June 24, 2010 By Visio Guy 26 Comments

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:

NonPrinting =TRUE

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!

  • Tweet
  • More
  • Pocket
  • Share on Tumblr
  • Print
  • Email

Related posts:

  1. Center-sizing Smart Shapes
  2. Title Blocks #1: How to Display Existing Document Information
  3. Visio Minions SmartShape Concept
  4. Truly “No-Glue-To” Shapes
  5. Visio Nerd Videos – For Developers!

Filed Under: Power User, Shapes, ShapeSheet Tagged With: ribbon

Previous Post: « Menus to Ribbons: Find Commands in Office 2010!
Next Post: Visio 2010 Backstage Options Mega List »

Reader Interactions

Comments

  1. Jumpy says

    June 24, 2010 at 3:39 pm

    Don’t know ribbons, but isn’t it possible to create a button in the ribbon, or in older Versions the menu, that does the same?

    In any case a good tool for people with many pages. I think it was asked about sth. like that in the forum, too.

    Jumpy

  2. Visio Guy says

    June 24, 2010 at 5:07 pm

    Hi Jumpy,

    Yes, for Visio 2010 it is pretty easy to add this to the ribbon. I think my client was either using an older version of Visio, or needed to build the functionality into existing shapes.

    This article shows how to make a button shape, but you could build it into any shape, quite easily. I think that is what we ended up doing.

  3. Visio Tart says

    June 25, 2010 at 1:03 am

    Greetings Chris lad!

    Standard Windows users are generally not used to having to “double-click” on anything to activate a button. Since Visio allows the addition of an ActiveX control on the page, you can use a VBA Forms Button (found in Visio 2010 on the Developer Tab, in the Controls Area, on the Insert Item [ button control ] ) instead of a Visio SmartShape.

    Each Command Button ActiveX Control would have the following code associated with it’s Click Event:

    Private Sub CommandButton1_Click()
    CallPageDialog
    End Sub

    And then a module would contain the following procedure:

    Public Sub CallPageDialog()
    Dim appVisio As Visio.Application
    Set appVisio = Visio.Application
    appVisio.DoCmd (visCmdOptionsGoToDrawing)
    End Sub

    I’ll send along a Visio diagram with all of this in place.

    David (The Visio Tart) Edson

  4. Visio Guy says

    June 25, 2010 at 1:06 am

    Thanks David!

    Extra points for posting code, too!

    I figured anybody who actually does this is a “non-standard” Windows users anyway. Plus I wanted to show places for navigating pages and introduce the DOCMD ShapeSheet function.

  5. Visio Guy says

    June 25, 2010 at 1:07 am

    Oh, and show off a cool button shape to boot! (Note the chiseled text effect…look close!)

  6. Roosje says

    June 25, 2010 at 9:18 am

    Great shape……but it doesn’t work when publishing the Visio web drawing with SharePoint 2010….

  7. Visio Guy says

    June 25, 2010 at 1:13 pm

    Hi Roosje,

    One wouldn’t expect this to work in a web-published document.

    It is using Visio facilities to do the work. When you double-click the shape, you are getting a Visio dialog box that helps you navigate to a different page, not any kind of hyperlinking functionality.

    For this to work in Save as Web, then Visio would have to export itself as one huge java-script program so that all Visio functions were available in the browser! 🙂

  8. marcus says

    June 28, 2010 at 3:00 pm

    At first a big thanks for this page, its very intressting to read plus a very good style to from.

    Is there also the possibility to change the hight or width of all available shapes on the page via such a DOCMD or something different but does the job?

    Thanks in advance!
    -Marcus

  9. Visio Guy says

    June 28, 2010 at 4:46 pm

    Hi Marcus,

    For blasting new values to Width or Height, SETF would work better. For example:

    EventDblClick = SETF(GETREF(Width), 15mm )

    or

    EventDblClick = SETF(GETREF(Width), Prop.AußenLänge )

    This article: The Hidden World of Visio Shapes shows examples of SET being used to turn layer-visibility on and off, might be worth a look as well.

  10. FreezeDK says

    September 12, 2010 at 11:25 am

    First of all, i often visit your GREAT site!

    In Visio 2010 (new feature) you can rightclick the page tabs [forward, back, fast forward, rewind buttons] area. As in Excel (at least since 97) this will list the first few pages/tabs (9 in my window), and have a [more pages…] option below, showing the Pages dialog.

  11. Visio Guy says

    September 12, 2010 at 6:11 pm

    FDK,

    Totally cool tip. I usually right-click just about everything, but I missed right-clicking on the forward/backward buttons in Visio 2010.

    Thanks!

    Chris

  12. visualthing says

    December 18, 2010 at 2:18 am

    In addition to right-clicking on the left/right page buttons and choosing [More pages…], you can launch the Page dialog by simply clicking on the page number.

    In Visio 2010 (at least) all it takes is a single left-click where it says “Page x of y.”

    Many thanks for a truly indispensable site.

    –Mac

  13. Visio Guy says

    December 20, 2010 at 11:06 pm

    Nice tip, VT, thanks!

  14. Shane says

    April 19, 2011 at 2:32 am

    Does anyone know how to restore the double-click hyperlink function from Visio 2007 in Visio 2010?

    In 2007 I could simply right click on any object and select a double-click action, now stupidly MS has removed this feature so if you open a Visio 2007 doc in 2010 the hyperlinks don’t work and just produce errors!!! WTF??? What’s wrong with MS development? How come they still keep making these stupid mistakes?

    Please heeelllppp???? Tks.

  15. Visio Guy says

    April 19, 2011 at 1:06 pm

    Hi Shane,

    1. Right-click on the Ribbon and choose “Customize Quick Access Toolbar”.
    2. Choose “All Commands” in the top-left drop-down.
    3. Find “Behavior…” in the list, and Add >> it to the list on the right, then click OK.
    4. Select a shape, then click the new Behavior button in the QAT. You’ll find the familiar Double-Click tab in the dialog that appears.

  16. Jordan says

    October 26, 2011 at 1:17 am

    I’ve just been clicking on the “Page of ” in the very bottom left of the screen to pop up this menu. I’ve also found that ctrl + Z will jump me back to my previous page (provided I haven’t done anything since coming to the current page), and ctrl + Y does the same for jumping forward (again, providing I haven’t done anything since jumping back)

  17. Hans Jensen says

    January 23, 2012 at 4:23 pm

    This is a very cool tip on how to use shapes for actions, and also on how to make the shapes invisible to printout. Thank you for sharing!

  18. Ted Calloway says

    February 29, 2012 at 5:28 pm

    Does anyone know how to print a list of Visio pages? I have a Visio document with almost 200 pages. It would be great to be able to create a list in Excel or Word to track certain metadata about all of the pages.

    Thanks

  19. Visio Guy says

    March 1, 2012 at 9:09 am

    Hi Ted,

    If you are a bit handy running a VBA macro, this code will list your pages in the Immediate window of Visio’s VBA editor:

    [code lang=”vb”]
    Sub PrintPageNames()

    Dim doc As Visio.Document
    Set doc = Visio.ActiveDocument

    Dim pg As Visio.Page
    For Each pg In doc.Pages
    Debug.Print pg.Name
    Next

    End Sub
    [/code]

    From Excel, with the Visio document open, this code will list the page names in column A:

    [code lang=”vb”]
    Sub PrintPageNamesInExcel()

    Dim visApp
    Set visApp = GetObject(, "visio.application")

    Dim visDoc
    Set visDoc = visApp.ActiveDocument

    Dim xlWksht As Excel.Worksheet
    Set xlWksht = Excel.ActiveSheet

    Dim iRow As Integer
    iRow = 1

    xlWksht.Cells(iRow, 1).Value = "Page Name"

    Dim visPg
    For Each visPg In visDoc.Pages
    iRow = iRow + 1
    xlWksht.Cells(iRow, 1).Value = visPg.Name
    Next

    End Sub
    [/code]

    See this article for the solution to a related problem:

    Export All Pages in Document

  20. jel888 says

    March 13, 2012 at 7:42 pm

    Follow-up question on Roosje’s point, so can you or anyone tell a non techie type how this could be done (moving from one page to another page via a click or double-click on a shape within a SP website environment (using a Visio 2010 file as the base)?

  21. Visio Guy says

    March 13, 2012 at 9:26 pm

    The standard hyperlinking feature should work just fine in SharePoint (I don’t have an environment handy to test).

    The point of this article was to pop-up a table of pages for lengthy documents to help users jump to *any* page–a navigation helper, so to speak.

  22. jel888 says

    March 20, 2012 at 6:57 pm

    Thanks and though I did understand the point of the article, I figured it was best to benefit from the knowledgeable audience and yourself on a related matter. Super thanks!

  23. Dave Mac says

    August 30, 2012 at 8:37 pm

    There is a much easier way to accomplish this, if you don’t mind using a drop down menu from a toolbar.

    1. Right-click in any blank portion of the toolbar area (or on the border of adjoining toolbars) to bring up the menu of toolbars.
    2. Choose Customize… from the bottom of the menu – the only command on the menu that’s not actually a toolbar. This should bring up the Customize menu. Click on the Commands tab.
    3. Click on Edit in the Categories list on the left and then scroll down to Go To Page in the Commands list on the right.
    4. Drag the Go To Page command to whatever active toolbar you want it to reside in.

    Now you’ll have the list of pages as a handy drop down menu right on the toolbar of your choice. Going to a page is now a simple click-select sequence.

    As far as I know this is available in all versions of Visio.

  24. Visio Guy says

    August 31, 2012 at 5:52 pm

    Great tip, Dave M!

  25. A B says

    September 26, 2014 at 11:02 am

    Hope you can help me.

    Versions : Visio – 2010, Word – 2010, SharePoint 2010
    I am working on a Visio diagram which will be used in Sharepoint. So I am using the Visio Web Diagram Format in Visio.
    I have my different shapes connecting to bookmarks in large Word documents. When testing in Visio itself, the hyperlinks to the bookmark work correctly and take me to the page where the bookmark is defined.
    When I upload the same diagram to Sharepoint and click on the same shape, it opens up the word document, but it doesn’t take me to the bookmark, It opens the document on first page.
    Am I missing something in this set-up? Do I need to take any extra steps for the bookmarks to work from Sharepoint?

  26. Steve says

    March 10, 2015 at 5:06 pm

    I’m a huge fan of data linking shapes to databases to display shapesheet metadata. However, this quickly becomes a huge mess when more than a few shapes are linked since the shapesheet data covers large portions of the drawing.

    Can someone suggest a way to use VBA to auto-hide the shapesheet data and display it only when the mouse is hovered over the shape? An example would be enormously appreciated!

Leave a Reply Cancel reply

Primary Sidebar

Buy Über Bubble Revision Shape
Purchase

Categories

Buy my book!

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

A/V Artistic Effects BPM Code Connectors Control Handles Countries Custom Patterns Custom Properties Data Graphics Data Linking Data Visualization David Edson David Parker Fill Format Formulas Functions Geometry Gradient Images Links Maps Multi-shapes Network Programming repeating shapes Resources Right-Click Actions Scale Shape Data ShapeSheet ShapeSheet Formulas ShapeSheet Functions SharePoint shiny SmartShapes Sport Sports Text Themes Tools Transparency User-defined Cells Visio 2007 Visio SmartShapes

Top Posts & Pages

  • - Visio Shapes & Stencils
  • - Visio Templates & Drawings
  • Amazon AWS Visio Shapes
  • Dynamic Updating Org Charts in Visio!
  • Text on a Circle Visio Shape
  • Bubble Revision Shapes
  • Crayon Visio Network Shapes, Revisited
  • Map of World
  • Sankey Diagram Shapes for Visio
  • AV Engineering Diagrams with Symbol Logic ECAV

www.visguy.com - Visio Guy - since 2006

 

Loading Comments...