Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hyperlink Visio Characters object

Tags:

vba

visio

I'm working on a VBA macro to automatically add hyperlinks within a drawing file, so that when a certain word is mentioned in the text, I can link to another page in the drawing.

According to MSDN and Visio's help, a Hyperlink object can be associated with a cell, characters, row, or section object. However, I can't find any way to actually associate a hyperlink with anything but a shape.

So the question is, how can I hyperlink a single word within a paragraph of text in a single shape in Visio?

like image 330
Jon Fournier Avatar asked Nov 25 '25 05:11

Jon Fournier


1 Answers

I'm only familiar with two ways to trigger a hyperlink navigation within Visio:

  1. Add a Hyperlink to a shape and click on the shape (or select the hyperlink from the shape's context menu).
  2. Add a call to the Hyperlink shapesheet function in a cell formula. Making a change that triggers that cell's recalc would then follow the hyperlink.

The best idea I can think of, and it isn't very good, is:

  1. Make sure your shape is a group - if it isn't, convert it to group.
  2. Change the group's properties to SelectMode=visGrpSelModeMembers1st and DisplayMode=visGrpDisModeBack.
  3. Drop a new shape, sized and centered over the word in question. Make the new shape transparent (partial transparency here could be used for highlighting).
  4. Change the DblClick event's formula to "Hyperlink("yourURLhere")".
  5. Add that shape to the group.

Now, double-clicking on the word should actually involve double-clicking on the new subshape, which will trigger the hyperlink. This is really only viable if your shape is designed to work with this idea - many out-of-the-box shapes will not work well here, as steps 1 and 2 can have ugly side-effects.

I hope someone else knows a more elegant way around this problem.

like image 151
Mike Woolf Avatar answered Nov 27 '25 19:11

Mike Woolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!