Removing hyperlinks from a paragraph

M

Michael Singmin

Hello Group,

Can one use VBA to to remove a number of hyperlinks in a section ?
If I select a group of text in which there are hyperlinks, the normal
R click menu leads to a greyed out "Remove Hyperlink"

Thanks,

Michael Singmin
Pretoria
 
J

Jonathan West

Michael Singmin said:
Hello Group,

Can one use VBA to to remove a number of hyperlinks in a section ?
If I select a group of text in which there are hyperlinks, the normal
R click menu leads to a greyed out "Remove Hyperlink"

Thanks,

Hi Michael

This code will do the needful

Sub RemoveLinksFromSelection()
Dim n As Long
For n = 1 to Selection.Hyperlinks.Count
Selection.Hyperlinks(1).Delete
Next n
End Sub
 
M

Michael Singmin

Thank you Jonathan,

I am a seasoned Excel VBA programmer and your code is a good example
of Word VBA.

Much appreciated,

Michael

================================================================
 

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