• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Using Visio in Education for GIS
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Visualize Complex Processes with Microsoft Visio
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Visio / Creating Shape to Page Hyperlinks Automatically using Link Data to Shapes

Published on August 29, 2012 by David Parker

Creating Shape to Page Hyperlinks Automatically using Link Data to Shapes

I demonstrated how to import hyperlinks into Visio shapes in a previous post – see http://blog.bvisual.net/2007/11/15/importing-hyperlinks-into-visio-shapes/, however, one of my readers wanted to know if the same mechanism can be used to create an hyperlink to another page in the same Visio document, rather than to an external web page. Well, it can be done … with a little preparation.

The Link Data to Shapes feature will by default only create external links because it pushes values from designated Shape Data fields into Hyperlink rows. You can designate Shape Data columns by ticking the Data Type / Hyperlink checkbox:

image

In my example, I have put the values Page-1 or Page-2 in the Link column, and set this Data Type as String Hyperlink, and this sets an Hyperlink with an Address Page-1 or Page-2. However, other pages, and shapes, are entered into the Sub-address property, but Visio prevents you from setting this if there is anything in the Address property.

image

So, the challenge is push the Address values into the Sub-address automatically.

Fortunately, the name of the Hyperlink row is predictable because it is named according to the Label of the Shape Data row, with a prefix _VisDM_. Therefore, the Link Shape Data row will create an Hyperlink row named Hyperlink._VisDM_Link. Knowing this, you can prepare a Master shape to be linked to the data with some ShapeSheet formulas.

The first action is to create the named Hyperlink row in the master shape. Then I created two User-defined cells with some ShapeSheet formulas in them.

image

The first User-defined cell is called LinkTrigger, and this contains the formula to move the Address to the Sub-address cell, if the Address does not start with http :

=DEPENDSON(Hyperlink._VisDM_Link.Address,Hyperlink._VisDM_Link.SubAddress)+IF(AND(NOT(STRSAME(LEFT(Hyperlink._VisDM_Link.Address,4),”http”,TRUE)),LEN(Hyperlink._VisDM_Link.Address)>0),SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””&Hyperlink._VisDM_Link.Address&””””)+SETF(GetRef(Hyperlink._VisDM_Link.Address),”=”””””),IF(LEN(Hyperlink._VisDM_Link.Address)>0,SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””””),0))

The second User-defined cell is called LinkInvisibleTrigger, and this is required to reset the Invisible cell formula because the Link Data to Shapes feature will put the formula =LEN(Hyperlink._VisDM_Link.Address)=0 into that cell, and this will hide your carefully constructed Sub-address hyperlink:

=DEPENDSON(Hyperlink._VisDM_Link.Invisible)+SETF(GetRef(Hyperlink._VisDM_Link.Invisible),”=GUARD(AND(LEN(Hyperlink._VisDM_Link.Address)=0,LEN(Hyperlink._VisDM_Link.SubAddress)=0))”)

These two User-defined cell formulas will ensure that the data-linked shape will get an hyperlink to another page in the document (provided that you have entered a valid page name!).

image

You should be aware that the hyperlinks will not get automatically updated if you change the names of the pages. You should go back to your data source and update the values there before refreshing the shapes from it.

The hyperlink will be available from the right-mouse menu of each shape:

image

As an optional extra, you could use the following formula in User.LinkTrigger value cell if you want to also modify the Double-Click event of the shape to automatically go to the page:

=DEPENDSON(Hyperlink._VisDM_Link.Address,Hyperlink._VisDM_Link.SubAddress)+IF(AND(NOT(STRSAME(LEFT(Hyperlink._VisDM_Link.Address,4),”http”,TRUE)),LEN(Hyperlink._VisDM_Link.Address)>0),SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””&Hyperlink._VisDM_Link.Address&””””)+SETF(GetRef(Hyperlink._VisDM_Link.Address),”=”””””)+SETF(GetRef(EventDblClick),”=GOTOPAGE(“””&Hyperlink._VisDM_Link.Address&”””)”),IF(LEN(Hyperlink._VisDM_Link.Address)>0,SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””””),0))

QED.

Related

Filed Under: Visio, Visio 2010 Tagged With: Hyperlinks, Link Data to Shapes, Visio 2007

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Comments

  1. shawnhishere says

    June 16, 2015 at 8:25 pm

    This worked beautifully – for some reasone the double click code isn’t working though.

    DEPENDSON(Hyperlink._VisDM_Link.Address,Hyperlink._VisDM_Link.SubAddress)+IF(AND(NOT(STRSAME(LEFT(Hyperlink._VisDM_Link.Address,4),”http”,TRUE)),LEN(Hyperlink._VisDM_Link.Address)>0),SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””&Hyperlink._VisDM_Link.Address&””””)+SETF(GetRef(Hyperlink._VisDM_Link.Address),”=”””””)+SETF(GetRef(EventDblClick),”=GOTOPAGE(“””&Hyperlink._VisDM_Link.Address&”””)”),IF(LEN(Hyperlink._VisDM_Link.Address)>0,SETF(GetRef(Hyperlink._VisDM_Link.SubAddress),”=”””””),0))

    Please advise what’s wrong.

    Reply
    • davidjpp says

      June 17, 2015 at 12:28 pm

      I think that WordPress has displayed incompatible double-quotes … try replacing all of the double-quotes with the one in Visio.

      Reply
  2. shawnhishere says

    June 23, 2015 at 8:28 pm

    I was able to get the code to take, however, I double click and nothing happens. Am I supposed to put this same formula in the EventDblClick tab? if not, what am I supposed to put in that tab?

    Reply
  3. Paul Hofmann says

    September 21, 2015 at 8:59 pm

    I am attempting this in Visio Pro 2013, but get “Error in formula.” when attempting to save either the LinkTrigger orLinkInvisibleTrigger formulas.

    Reply
  4. Paul Hofmann says

    September 22, 2015 at 4:30 pm

    An alternative, working for me in Visio Pro 2013, is to specify the page link as “MyDiagram#MyPage” along with setting the Data Type as String Hyperlink. That value goes into the Address field, and there is no need to move it to Sub-address.

    Reply
  5. Dian Ledbetter says

    April 7, 2020 at 9:45 pm

    I have been trying to get the 2 options presented to work, but I am having no luck.

    If the MyDiagram name has spaces, will that break that simpler option?
    If I need to use the ShapeSheet formulas, where do I put those? It looks like it would be in my Excel sheet but I don’t have those options anywhere that I can find.

    Note I need this work when I make the Visio into a pdf as well. Help, please!

    Reply
    • David Parker says

      April 8, 2020 at 8:26 pm

      Hi! The formulas have to be added to the User-defined Cells section of the ShapeSheet of the master. I have edited the Department and Person masters in this document to demonstrate : Intra Document Links.vsdx

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript LayerManager Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Setup and Deployment Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Validation VBA Video Visio Visio 2007 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • Amazon
  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Search this website

Recent posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Copyright © 2025 · Executive Pro on Genesis Framework · WordPress · Log in