Follow a hyperlink via keyboard

P

Paul B

Hi,

I'd like to follow hyperlinks, such as are in ToCs, using the
keyboard rather than the mouse.

I don't see a preset command I can assign to the keyboard, and my
attempts at the likes of 'Selection.GoTo.Hyperlinks (1)'
have failed.

Is there any way to do this?

Thanks much,
p.
 
P

Pesach Shelnitz

You need to use the Follow method of the Hyperlink object. The following
macro will follow the selected hyperlink or the first hyperlink in the
selected text.

Sub FollowHyperlink()
If Selection.Hyperlinks.Count >= 1 Then
Selection.Hyperlinks(1).Follow
Else
MsgBox ("No hyperlink is selected.")
End If
End Sub
 
P

Paul B

You need to use the Follow method of the Hyperlink object. The following
macro will follow the selected hyperlink or the first hyperlink in the
selected text.

Sub FollowHyperlink()
If Selection.Hyperlinks.Count >= 1 Then
Selection.Hyperlinks(1).Follow
Else
MsgBox ("No hyperlink is selected.")
End If
End Sub

Ah, that is gorgeous!

Thanks much (and my right wrist thanks you as well)!

p.
 
P

Paul B

Ah, that is gorgeous!

Thanks much (and my right wrist thanks you as well)!

p.

The only downside is that navigating through a document via
keyboard this way does not register in the historical navigation
stack. Thus, the Web Back or Forward commands (Alt-Left/Right) do
not work. That's a major drawback many times.

p.
 

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

Top