Which hyperlink is clicked

  • Thread starter Thread starter wgyee
  • Start date Start date
W

wgyee

Hi, I'd like to know is there any way to trigger which
hyperlink (not shape) is clicked?

Thanks!
 
Can you explain further? Since it's a human being who does the clicking,
there isn't anything automatic you can set up. I'm not sure that I
understand the question. What is the situation that you are trying to set
up?

Sonia, MS PowerPoint MVP Team
http://www.soniacoleman.com
(Tutorials and Autorun CD Project Creator)
PowerPoint Live! - Featured Speaker
Tucson, AZ; October 12-15, 2003
 
Thanks Sonia,

What I wanna do is like the example "Determine which
shape was clicked" in
http://www.mvps.org/skp/ppt00040.htm#2. But I want to
determind which text link was clicked before the slide
change to the link target.

There're events about presentation, slide show & window,
but no hyperlink event, so I'd like to know if it's
possible get those information when on click.

Thanks again!
 
Ah. And here I am ever so VBA challenged. To get the attention of the
right people, why don't you re-post your question and make the subject line
something like "VBA - Detecting mouse click on hyperlink", and if you have
tried some code that doesn't work, paste it in your note.
 
I'm not a VBA guru, by any means, but it seems like you are using the wrong
way to get what you want.

If you use a hyperlink, it will behave like a hyperlink. It's not a bad
thing, it just is what it is.

Why not use a shape (text box, clear rectangle, whatever) to trigger your
code (that will do the stuff you need done first), then use additional code
to do what the hyperlink would have?



B
 
I somehow missed the point of this earlier.

Some of these bits may help:

You can use the code you already have from Shyam's example to find the shape
name.

Sub AboutTheHyperlinks()

Dim oHL As Hyperlink
Dim oRng As TextRange

For Each oHL In ActivePresentation.Slides(1).Hyperlinks
' Get a reference to the text range containing the hyperlink
Set oRng = oHL.Parent.Parent
' You could work with its Boundxxx properties to identify it vs the
others
MsgBox oRng.BoundLeft
MsgBox oRng.BoundTop
' what's the name of the shape that contains it?
MsgBox oRng.Parent.Parent.Name
Next oHL

End Sub

--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com
 
See .... I told you I wasn't a guru.

Ok, I've got a question for my own curiosity/understanding: When will the
sub execute in relation to the hyperlink jump? (Before, at the same time,
or after) I didn't see a trap to hold off the execution of the link, and
it's just that the original poster seemed to need to run code prior to the
link jump. How do you hold off this event?

(g)
B
 
See .... I told you I wasn't a guru.

Nor am I. I just happened to have an idea how this might work. said:
Ok, I've got a question for my own curiosity/understanding: When will the
sub execute in relation to the hyperlink jump?

As written, it won't execute at all - it's just a way of getting learning
the name of the object containing the link and such.
or after) I didn't see a trap to hold off the execution of the link, and
it's just that the original poster seemed to need to run code prior to the
link jump. How do you hold off this event?

I don't think you can hold it off, but the link could be to run a macro
rather than to do anything specific; the macro could actually execute the
link based on the shape name or a tag applied to the shape, etc.

IOW, I guess it depends on what the OP's after.
 
Back
Top