Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visio 2013 - VBA question - Double-click a shape and open browser/download a file

Posted on 2014-03-10
3
Medium Priority
?
3,999 Views
Last Modified: 2014-03-11
When I double-click a shape I would like to have a browser open up and hit a particular web page.
What is the code to do this?

When I double-click a shape I would like to have a browser open up and download a particular file.
What is the code to download a file which is located at: http://www.site.com/stuff.pdf
0
Comment
Question by:brothertruffle880
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39917743
Hi,

to run a macro when dbl-clicking a shape

refer to http://msdn.microsoft.com/en-us/library/office/ff765424(v=office.15).aspx

EDIT
to download a file from an URL pls try

http://www.experts-exchange.com/Database/MS_Access/Q_26287511.html

Regards
0
 
LVL 31

Accepted Solution

by:
Scott Helmers earned 2000 total points
ID: 39920258
Two options:

1) If having the user type Ctrl+click instead of double-click is OK, then just add a hyperlink to the shape via the hyperlink dialog (Ctrl+K).

2) But if you want the user to double click, you can actually accomplish that without a macro because every Visio shape has a built-in double click event. You can set the event for many purposes by selecting the shape, clicking the Behavior button on the Developer tab, and then clicking the Double-Click tab.

In this case, however, you can't set a link to a URL from the UI. Instead, you just need to place a formula containing the HYPERLINK() function into the shape's EventDblClick cell in the ShapeSheet:
-- turn on the Developer tab if it's not already
-- right-click the shape and select Show ShapeSheet
-- scroll down to the Events section
-- type this formula into the EventDblClick cell
        =HYPERLINK("http://www.site.com/stuff.pdf")

There's an example below.event double-click cell There are additional options for the HYPERLINK() function as documented in the Visio help text.
0
 

Author Comment

by:brothertruffle880
ID: 39920343
Scott:
I love you!  That was the answer I was looking for!!!!  That shapesheet tweak is what I needed!


bt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Security is one of the biggest concerns when moving and migrating your data from your on-premise location to the Public Cloud.  Where is your data? Who can access it? Will it be safe from accidental deletion?  All of these questions and more are imp…
If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

618 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