Hyperlinks to SharePoint Lists from Visio Shapes

My previous post showed how to link Visio Timelines to a SharePoint Calendar ( http://bvisual.spaces.live.com/blog/cns!3350D61BC93733A9!552.entry ), and I glibbly mentioned how you can create hyperlinks automatically on the shapes from the SharePoint list.  Well, that was true, but the example shown goes to a SharePoint page, and it didn’t work.  So, I feel I need to demonstrate a fix for it.

image

The ShapeSheet formula in the hyperlink address cell is:

image

=SETATREF(Prop._VisDM_Encoded_Absolute_URL)

This translates to the URL:

http://www.wssdemo.com/Lists/Calendar/1_.000

Well, this does not actually work from Visio, but, navigating to the entry in the SharePoint calendar shows that the actual URL is:

http://www.wssdemo.com/Lists/Calendar/DispForm.aspx?ID=3&Source=http%3A%2F%2Fwww%2Ewssdemo%2Ecom%2FLists%2FCalendar%2Fcalendar%2Easpx%3FCalendarDate%3D25%252F12%252F2006

… and this can be reduced to:

http://www.wssdemo.com/Lists/Calendar/DispForm.aspx?ID=3

So, how can we correct the URL for the Visio shapes?

We will need to write a little bit of code to change the formula in the hyperlink Address cell to :

=REPLACE(Prop._VisDM_Encoded_Absolute_URL,LEN(Prop._VisDM_Encoded_Absolute_URL)-4-LEN(FORMAT(Prop._VisDM_ID,”#”)),LEN(FORMAT(Prop._VisDM_ID,”#”))+5,”DispForm.aspx?ID=”&FORMAT(Prop._VisDM_ID,”#”))

This will change the URL to actually open the SharePoint page, like this:

image

I will write the code when I can get my Office programs working again….

http://bvisual.spaces.live.com/blog/cns!3350D61BC93733A9!590.entry

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Chris Webb's BI Blog

Microsoft Analysis Services, MDX, DAX, Power Pivot, Power Query and Power BI

davecra.wordpress.com/

Microsoft Office 365 Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: