application.followhyperlink

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Have you checked with your network people to see what the network macro
security setting is?
 
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
 
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)
 
Back
Top