john c. j.
john c. j.

Reputation: 1175

Apply style to hyperlink

Is there a way to apply style to hyperlink, without selecting it?

For example, this works:

Sub ChangeStyle()
    Selection.Range.Hyperlinks(1).Range.Fields(1).Result.Select
    Selection.Style = Word.WdBuiltinStyle.wdStyleHyperlinkFollowed
End Sub

But I don't like the gray selection area:

enter image description here

Here is what I try to accomplish:

enter image description here

Upvotes: 0

Views: 133

Answers (1)

braX
braX

Reputation: 11755

Try it like this:

Sub ChangeStyle()
    Selection.Range.Hyperlinks(1).Range.Fields(1).Result.Style = Word.WdBuiltinStyle.wdStyleHyperlinkFollowed
End Sub

Upvotes: 1

Related Questions