T
tjtjjtjt
A few days ago I posted this code to try and get a version of it that would
work on Selected text only.
Sub UnlinkHyperlinks()
Dim nHL As Long
For nHL = 1 To ActiveDocument.Hyperlinks.Count
ActiveDocument.Hyperlinks(1).Delete
Next nHL
End Sub
I had tried just changing AcitiveDocument to Selection, but I always got
Runtime error: 5941.
Several people tried to help me find out what was wrong. It turns out, the
code only fails when the selected text start at the beginning of the
hyperlink.
Does anyone have an idea as to why this would happen?
Thanks,
work on Selected text only.
Sub UnlinkHyperlinks()
Dim nHL As Long
For nHL = 1 To ActiveDocument.Hyperlinks.Count
ActiveDocument.Hyperlinks(1).Delete
Next nHL
End Sub
I had tried just changing AcitiveDocument to Selection, but I always got
Runtime error: 5941.
Several people tried to help me find out what was wrong. It turns out, the
code only fails when the selected text start at the beginning of the
hyperlink.
Does anyone have an idea as to why this would happen?
Thanks,