[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Forming a URL using custom properties

Posted on 2009-02-17
9
Medium Priority
?
488 Views
Last Modified: 2012-05-06
I need to create a dynamic URL for each shape in my Visio drawing using custom properties defined within the shape.  Is this possible?

For example, I have a custom property called Shape_ID.  The value of this property will be different for each shape.  When a user clicks on the shape, I need the URL to be to a destination that includes Shape_ID on the end.  I thought I would just use something like the following:

="http://www.someplace.com/" + Prop.Shape_ID

...but this doesn't work.

One more note, I already know how to add a hyperlink to a shape.  I just don't know how to make it dynamic.
0
Comment
Question by:Mountaineer72
  • 5
  • 4
9 Comments
 
LVL 31

Expert Comment

by:Scott Helmers
ID: 23671470
Yes it's possible, and your approach seems right. Are you sure it isn't just a URL syntax issue? For example, if your shape ID is "test1", is
a valid URL? Or should it be one of the following, depending on your web site construction:
or similar variations...

0
 
LVL 3

Author Comment

by:Mountaineer72
ID: 23672446
bullet #1 is the correct format.  When I click the shape (after inserting the hyperlink), it tries to go to the literal value of what I typed in..."http://www.someplace.com/" + Prop.Shape_ID
0
 
LVL 31

Expert Comment

by:Scott Helmers
ID: 23677313
Take a look at the graphic below -- it's the shapesheet for an object on which I've done what I think you're asking about... there's one custom property called shape_ID and it's included in the hyperlink address field by reference.

Note that I've used & instead of + although I think both are valid.

Does the address field for your hyperlink look like this or different?

HL-shapesheet.jpg
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 3

Author Comment

by:Mountaineer72
ID: 23682932
Interesting.  I don't see my property or hyperlink in the shape sheet.

I created my property by right-clicking on the shape and selecting shape data.  I then added a hyperlink from the insert menu.  I entered "http://www.gosomewhere.com/"&Prop.Shape_ID.  When I open the shape sheet, I don't see any of this information.
0
 
LVL 31

Expert Comment

by:Scott Helmers
ID: 23684237
Ah -- the old vanishing hyperlink trick!

Seriously, though, I'm not sure what's happening if the hyperlink doesn't show up in the shapesheet -- if it's not there, it doesn't exist as far as Visio is concerned. Yet you say that you can click to follow the hyperlink...

Is this a simple shape or a group? If the latter, perhaps the hyperlink is attached to the group and not a sub shape -- or vice versa.

One more note: I just tried typing a link with reference to custom props in the way that you did and it doesn't work. I created the example above by typing the link directly in the shapesheet. The UI dialog apparently doesn't support hyperlinks with formulas.

BTW, if you want to post a drawing for me to look at, I'd be happy to do so. If you attach it here you'll have to change the file extension to a file type that EE supports, like .txt, or you can email the file to me at the address in my profile.
0
 
LVL 3

Author Comment

by:Mountaineer72
ID: 23684674
Here is a simple example using the method I've been attempting.  
HyperlinkTest.txt
0
 
LVL 31

Expert Comment

by:Scott Helmers
ID: 23685397
The issue appears to be what I commented about above -- the hyperlink dialog does not allow entry of a formula. When you type
   http://www. & prop.shapeUrl
Visio assumes that it is all one string, so it wraps it in quotes and plunks it into the shapesheet. Consequently, the formula never gets evaluated.

When you try to isolate the parts by typing
   "http://www." & prop.shapeUrl
it still wraps the entire thing in quotes.

However, if you manually enter the proper syntax into the shapesheet, the formula works correctly. I modified the square in v2 of your drawing to have the correct syntax. (Note that if you open the hyperlink dialog for the square, the dialog displays the result of the formula not the formula itself.)

Bottom line appears to be that you can't enter a formula into the hyperlink dialog. Perhaps if you describe your overall objective, there might be a way around this...



HyperlinkTest-v2.txt
0
 
LVL 3

Author Comment

by:Mountaineer72
ID: 23685562
I've created a process workflow in visio.  For each activity, there is a detailed definition located on a web-site somewhere.  The URL for the details corresponds to the activity's assigned ID.  Instead of hardcoding the hyperlink in every shape (activity).  I would like to define the base URL once and then append the shape's activity ID.  This would allow a person to click on a shape (activity) and then be taken to a web-site where he/she can see the details.  On a related note,  I'm going down this path so that the processes can be managed/maintained independently from the activity details.
0
 
LVL 31

Accepted Solution

by:
Scott Helmers earned 2000 total points
ID: 23685832
I suspected it was something like that... in which case there may be a way.

Every Visio document has a property called the "hyperlink base". To set it select File/Properties and look toward the bottom of that dialog for the hyperlink base field. Note that there is only one for the entire document.

I'm not 100% certain of the rules for using it but it appears that the base must include a full domain name. For example, if you set the base to
   http://www.taskmap.com
and set the shape hyperlink to
   support.html
when you follow the link you'll end up at our support page. (NOTE: the / after ".com" in the base field is optional.)

Note, however, that if you set the base to
   http://www.
and the HL to
   taskmap.com
it will not work. I don't think this will be a problem because I suspect from your initial question that the target pages are all at the same base URL.

Two additional notes:
  • the hyperlink on each shape must be a relative link, i.e., there must be a checkmark next to Use relative path for link in the  hyperlink dialog box
  • Relative hyperlinks are only available if you have first saved the document, i.e., if you are unable to put a checkmark next to Use relative path for link, it's probably because you haven't saved the document yet.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically someone asks me whether there’s a way to automatically convert all of the pages in a Visio drawing to PowerPoint slides. There have even been a few times when I’ve wanted to do that myself but I never really had enough incentive to figu…
Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question