Visio Guy

Visio Discussions => General Visio => Topic started by: Dougmeister on January 21, 2022, 01:46:48 PM

Title: Possible to click one shape and be taken to another in the same file?
Post by: Dougmeister on January 21, 2022, 01:46:48 PM
I have several Visio diagrams that are each several pages "wide".

Is it possible to click a shape in Visio file #1 and have it jump/"hyperlink" to a specific shape :

A) in a different section (but same page) of the same document?

B) on a different page of the same document?

C) in a different document?

Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Surrogate on January 21, 2022, 02:51:04 PM
Yes, you can do it!
Press Ctrl+K in this window you can set these options.
(https://i.imgur.com/orONsoy.png)
1st row for add hyperlink to another document
2nd row for add hyperlink to another page
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Dougmeister on January 21, 2022, 09:35:34 PM
Thanks, but it won't "set focus" to a particular shape, correct?
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: wapperdude on January 21, 2022, 11:37:00 PM
It can go to a specific shape if desired.  See following for more complete explanation:
https://support.microsoft.com/en-us/office/add-or-remove-a-hyperlink-in-a-visio-drawing-271fb2a8-4081-47db-a333-487315c05085 (https://support.microsoft.com/en-us/office/add-or-remove-a-hyperlink-in-a-visio-drawing-271fb2a8-4081-47db-a333-487315c05085)
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Yacine on January 22, 2022, 10:54:37 AM
I think the thing you're looking for is an off page reference.
(https://support.microsoft.com/en-us/office/continue-a-flowchart-on-a-separate-page-6e21dd6a-06d0-4111-b3dc-8a2e8ec94fb9 (https://support.microsoft.com/en-us/office/continue-a-flowchart-on-a-separate-page-6e21dd6a-06d0-4111-b3dc-8a2e8ec94fb9))


Having found and inserted the shape doesn't yet satisfy your needs - namely to create your own shapes.


You could copy the relevant cells of the off-shape-ref shape to your own shape, but this could get tedious and error prone.


I tried the following and it works.


1. transform the off-page-ref shape into a group.
2. delete the geometry sections
3. delete the action rows that allow to switch between the display types
4. finally open the off-page-ref GROUP and paste in your own shape.


----


Funny idea to follow is the fact that the navigation is defined by the user cells.
OPCShapeID, that's the GUID of the shape itself
OPCDPageID is the GUID of the TARGET page
and OPCDShapeID is the TARGET shape.


Having understood this mechanism one can now manipulate the shapes to create a chain of landing targets instead of just jumping forth and back,
thus creating a kind of presentation mode.


----
One last remark: Navigation by clicking once is not possible with regular shapes. You will need to double click. (otherwise you may need to use ActiveX buttons, but that's more complicated)


PS: This work for your scenarios 1 and 2. Case #3 requires the previously mentioned hyperlinks.

Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: vojo on January 25, 2022, 01:21:49 AM
dont you want the group to have "add child shape to group on drop"
and the child shape have "add shape to parent group on drop"

Both in the behavior section

Otherwise, not sure how paste would add to group vs just plopping the image on top of the group and
not taking any group level cell personality to the image level cell personality.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: wapperdude on January 25, 2022, 02:14:03 AM
@OP:
Attached are 2 test files.  Save them to a common directory, e.g., Documents.

File1, shape = Sheet.1, has multiple hyperlinks.  Two go to shapes within the document, and 3rd goes to the Sheet.3 shape in 2nd document.  To use, since, File1, Sheet.1 has the hyperlink examples, open that file.  Right click Sheet.1 shape and choose desired hyperlink.  File2 need not be opened. 

Note, when defining (editing) the hyperlinks, the browse buttons are very good thing to use.  Especially the 2nd one to browse for shape, as there is an entry for Zoom level. 

This should demonstrate the functionality questions that you raised.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Yacine on January 25, 2022, 08:18:47 AM
@Wapperdude, yours is much more straightforward.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Soundstorm on February 13, 2022, 03:01:58 PM
Quote from: Yacine on January 22, 2022, 10:54:37 AM
I think the thing you're looking for is an off page reference.
(https://support.microsoft.com/en-us/office/continue-a-flowchart-on-a-separate-page-6e21dd6a-06d0-4111-b3dc-8a2e8ec94fb9 (https://support.microsoft.com/en-us/office/continue-a-flowchart-on-a-separate-page-6e21dd6a-06d0-4111-b3dc-8a2e8ec94fb9))


Having found and inserted the shape doesn't yet satisfy your needs - namely to create your own shapes.


You could copy the relevant cells of the off-shape-ref shape to your own shape, but this could get tedious and error prone.


I tried the following and it works.


1. transform the off-page-ref shape into a group.
2. delete the geometry sections
3. delete the action rows that allow to switch between the display types
4. finally open the off-page-ref GROUP and paste in your own shape.


----


Funny idea to follow is the fact that the navigation is defined by the user cells.
OPCShapeID, that's the GUID of the shape itself
OPCDPageID is the GUID of the TARGET page
and OPCDShapeID is the TARGET shape.


Having understood this mechanism one can now manipulate the shapes to create a chain of landing targets instead of just jumping forth and back,
thus creating a kind of presentation mode.


----
One last remark: Navigation by clicking once is not possible with regular shapes. You will need to double click. (otherwise you may need to use ActiveX buttons, but that's more complicated)


PS: This work for your scenarios 1 and 2. Case #3 requires the previously mentioned hyperlinks.
I'm looking for a way to re-use the off-page reference, but I can't deciper the shapesheet to see how to do it.

Modifying the geometry doesn't seem to be an issue, but I want to add an extra text field. I'd like to have a reference ID and a reference text.
Additionally, I'd like to have a similar shape, but for an on-page reference.

I can do all this linking manually, but having the drag and drop feature is so handy.

Any tips on how I can do these modifications?

Thanks!
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Paul Herber on February 13, 2022, 05:46:15 PM
The off-page reference is controlled by an add-on that is built-in to Visio. You can't change the way it works.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Visisthebest on February 13, 2022, 06:05:32 PM
Thank you for sharing your knowledge Paul, I didn't know now I see indeed in the shapesheet for the double-click event on the Off-page reference shape:
=RUNADDONWARGS("OPC","/CMD=2")

I would say via a CALLTHIS call on a shape (in the cell for the double-click event) with VBA in the stencil something like this could be done quite well.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Soundstorm on February 14, 2022, 08:19:18 AM
Had a look at that, and it seems you can use the addon in your own shapes ass well.
https://techcommunity.microsoft.com/t5/microsoft-365-blog/going-off-the-page/ba-p/237251

This gave me some nice words to search for, and it seems there are many other people making the feature better. I'll look into those, maybe I can find a method on how to make this work like I want it to!
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Visisthebest on February 14, 2022, 10:42:06 AM
Soundstorm like Paul says, if you stay within the bounds of how it already works, you can use the existing addon.

The write-your-own-code option is more complicated in terms of developing & deploying it. You will also need a code signing certificate if you want to deploy VBA code to a lot of computers.
Title: Re: Possible to click one shape and be taken to another in the same file?
Post by: Paul Herber on February 14, 2022, 07:50:00 PM
I do wonder why the OPC addon doesn't give you the option to reference a shape directly, as the hyperlink data can refer to shapes. Also, even with the hyperlinks there is no option to actually select the shape referenced.