Code:
Sub Delete_Underlines()
'A basic Word macro coded by Graham Mayor,
'adapted by Greg Maxey, http://gregmaxey.com/word_tips.html, 10/4/2018
Dim oRng As Range
Dim oScope As Range
Set oRng = Selection.Range
Set oScope = oRng.Duplicate
With oRng.Find
.ClearFormatting
.Font.Underline = wdUnderlineSingle
.Replacement.ClearFormatting
Do While .Execute()
If oRng.InRange(oScope) Then
If oRng.Hyperlinks.Count = 0 Then
oRng.Select
If MsgBox("Do you want to remove underline from this instance", vbYesNo, "Actio") = vbYes Then
oRng.Font.Underline = wdUnderlineNone
End If
oRng.Collapse 0
End If
Else
Exit Do
End If
Loop
End With
lbl_Exit:
Set oRng = Nothing
Set oScope = Nothing
Exit Sub
End Sub