application.followhyperlink

G

Guest

I have a form with a pull down list of names(Name). I set up another box to
launch a file Name.doc when clicked. I would like the file associated with
the chosen name to launch when double clicked. Here's what I have but it
doesn't respond.

Private Sub Text194_DblClick(Cancel As Integer)
DocLocationAndName = "\\ad\userfiles\public\" & Me.Name & ".doc"
Application.FollowHyperlink DocLocationAndName
End Sub
 
G

Guest

Check Tools, Macro Security.

If it set to High, FollowHyperlink will not do anything.
If set to Medium, you get a warning.
If set to Low, it runs without a warning.

Be aware that if your Network people have their security set higher than
yours, it will override you.

If you can't use this for security reasons, you may have to go back to the
old Shell function method of opening an external document.
 
G

Guest

I checked and he Macro Security is set Low.

Klatuu said:
Check Tools, Macro Security.

If it set to High, FollowHyperlink will not do anything.
If set to Medium, you get a warning.
If set to Low, it runs without a warning.

Be aware that if your Network people have their security set higher than
yours, it will override you.

If you can't use this for security reasons, you may have to go back to the
old Shell function method of opening an external document.
 
G

Guest

Have you checked with your network people to see what the network macro
security setting is?
 
G

Guest

I still waiting for the IT group to respond. In the meantime, I switched to
the Shell command but it still doesn't respond. Am I doing something wrong?
Thanks

Private Sub Text194_DblClick(Cancel As Integer)
DocLocationAndName = "\\ad\userfiles\public\" & Me.Name & ".doc"
Shell DocLocationAndName
End Sub
 
G

Guest

It just occured to me that the reference you are making will return the name
of the form. Me.Name will return the name of the form. If you have a
control on the form called Name, change it. Access is getting confused.

Also, the Shell function requires an application name and the name of the
document to open has to be in quotes.
DocLocationAndName = "Word\\ad\userfiles\public\" & Me.Name & ".doc"
Call Shell("excel " & Chr$(34) & DocLocationAndName & Chr$(34),
vbMaximizedFocus)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FollowHyperlink question 4
application.hyperlink giving 490 error 6
Textbox Hyperlink Error 1
Error Message in Code 2
Access Microsoft Access - Subtotals for each page 0
Run Time Error 16388 1
Path definition 3
Kill Script 3

Top