Site icon bVisual

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:

=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:

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

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

Exit mobile version