Follow Hyperlink Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the Hyperlink Function to open a hyperlink in a field that
will allow users to specify what that hyperlink is. For fixed hyperlinks I
am successfully using the following:

Dim ctl As CommandButton

Set ctl = Me!SeeBlankTemplate
With ctl
.Visible = False
.HyperlinkAddress = "\\ibr2fodnjohnson\c$\shared files\Closeout Cover
Sample.doc"
.Hyperlink.Follow
End With

How do I state .HyperlinkAddress in a case where this varies?
 
Nicole,

I'm not sure I understand. Perhaps you could elaborate a bit more.

However, if all you are trying to do is 'open a hyperlink' then you can
simply use the Application.FollowHyperlink Method

Let say you have a textbox named hprlnk which has the path/filename to be
opened then it would look like

Application.FollowHyperlink Me.hprlnk

If on the other hand you are trying to create an interface which allows the
users to select a file and create a hyperlink based on the selected file then
you need to utilize the file open/save api

http://www.mvps.org/access/api/api0001.htm

Explain a bit more and I can try to guide you better.
 
Daniel:

Yes, all I want to do is open a hyperlink from a hyperlink text box.

Using...

Application.FollowHyperlink Me.hprlnk

....works to a certain extent. Now, if you can advise on how to eliminate
the auto error message which warns of the dangers of opening hyperlinks, I
can start cooking with fire. Clicking "Yes" to continue opening the
hyperlink causes Runtime Error "490." Any suggestions?

Nicole
 
Back
Top