Reputation: 1175
How to follow hyperlinks in Microsoft Word 2016?
This works fine in Excel:
' Works in Excel
Sub FollowURL()
ActiveCell.Hyperlinks(1).Follow
End Sub
However, when I try to change ActiveCell
to Selection
(assuming it is necessary for Word), it doesn't work:
' Doesn't work in Word
Sub FollowURL()
Selection.Hyperlinks(1).Follow
End Sub
Upvotes: 0
Views: 1862
Reputation: 10236
What about:
' Note: Ensure the selection contains "http://..."
' for example: http://www.google.com
ActiveDocument.FollowHyperlink Selection.Text
Note: That you check your firewall to let word use this function as @john c. j. mentioned in the comments.
Upvotes: 1