Author Topic: Auto Hyperlink  (Read 412 times)

0 Members and 1 Guest are viewing this topic.

Crazy Squirrel

  • Jr. Member
  • **
  • Posts: 27
Auto Hyperlink
« on: May 04, 2022, 10:54:26 AM »
Can't get this to work. Any ideas?

I have a rectangle to enter "Y" or "N". If "Y" is entered, I would like it to open the hyperlink.

=IF(STRSAME(SHAPETEXT(TheText),"Y"),"https://www.google.co.uk","")

(Google used as an example)

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4520
  • Ideas Visio-lized into solutions
Re: Auto Hyperlink
« Reply #1 on: May 04, 2022, 11:40:58 AM »
What do you mean by open the hyperlink?

Where is this IF statement instantiated?
Visio 2019 Pro

Crazy Squirrel

  • Jr. Member
  • **
  • Posts: 27
Re: Auto Hyperlink
« Reply #2 on: May 05, 2022, 03:00:16 AM »
If a user enters "Y", I would like the the Hyperlink to open a file on a SharePoint site automatically, without them holding ctrl and clicking.
I had the IF statement in the Hyperlink section on the shapesheet.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4520
  • Ideas Visio-lized into solutions
Re: Auto Hyperlink
« Reply #3 on: May 05, 2022, 09:03:56 AM »
Putting an IF statement in hyperlink section doesn't fully resolve the problem.  TheUser still needs to perform some action to trigger the IF statement.  A double click?  A right click to bring up a menu?  Hovering over the shape with the mouse? A special control shape on the page?  There will always be some initiating step by the User.  Using the <cntl> key is a flexible method built-in.  All other approaches require specific, case-by-case (for multiple hyper links) solutions.
Visio 2019 Pro

Crazy Squirrel

  • Jr. Member
  • **
  • Posts: 27
Re: Auto Hyperlink
« Reply #4 on: May 05, 2022, 11:08:08 AM »
Thanks for clarifying that. Is it possible to have a pop up message appear if "Y" is entered, and have the hyperlink in that message?

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4520
  • Ideas Visio-lized into solutions
Re: Auto Hyperlink
« Reply #5 on: May 05, 2022, 05:38:04 PM »
Sorry, somehow I misunderstood your intentions.  I'm not aware of any way to auto trigger the hyperlink.  It isn't necessary to use the <cntl> key method.  You can also right click on the shape and then click the menu entry in the popup window.

Otherwise, it looks like it'll take some code to achieve greater automation.
Visio 2019 Pro

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4520
  • Ideas Visio-lized into solutions
Re: Auto Hyperlink
« Reply #6 on: May 06, 2022, 01:16:41 AM »
Ah! A solution.  Use the HYPERLINK shapesheet function.  See https://docs.microsoft.com/en-us/office/client-developer/visio/hyperlink-function
NOTE:  This avoids creating the tranditional hyperlink that uses the <cntl> key.  I'd say this is the most efficient way to implement this.

As an example, create a User defined row and put this formula into the value cell:
=IF(STRSAME(SHAPETEXT(TheText),"Yes",),HYPERLINK("https://www.microsoft.com"),"")  If the shapetext = "Yes", the HYPERLINK will get the MS website. 

Or, alternatively, using the Actions section, enter this formula into the the Action cell: =HYPERLINK("http://visguy.com/vgforum/index.php"), and in the Menu cell, enter something like:  "_ Goto VisioGuy Forum".  This last entry will be an entry on the popup window.  Left click it and the HYPERLINK will execute.
« Last Edit: May 06, 2022, 01:19:04 AM by wapperdude »
Visio 2019 Pro

Crazy Squirrel

  • Jr. Member
  • **
  • Posts: 27
Re: Auto Hyperlink
« Reply #7 on: May 06, 2022, 05:55:55 AM »
Wapperdude, you are a bloody Genius.  I've used you 1st option and it works perfectly.  Thank you so much.