![]() |
#13
|
||||
|
||||
![]()
Your original message said that you wanted to remove underscores. Your example text displays underLINES and not underscores, which explains why nothing happens.
Try the following Code:
Sub Delete_Underlines() ' 'Graham Mayor - http://www.gmayor.com - Last updated - 03 Oct 2018 ' ' Delete_Underlines Macro ' Will delete all underlines in Document except in Mail addresses (& hyperlinks ??) Dim oRng As Range Dim oWord As Range Set oRng = ActiveDocument.Range With oRng.Find .ClearFormatting .Font.Underline = wdUnderlineSingle .Replacement.ClearFormatting Do While .Execute() If oRng.Hyperlinks.Count = 0 Then oRng.Font.Underline = wdUnderlineNone oRng.Collapse 0 End If Loop End With lbl_Exit: Set oRng = Nothing Set oWord = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a sub-Forum for Office for Mac? | IvanH | Office | 1 | 02-20-2014 11:31 PM |
![]() |
Joan64 | Office | 2 | 07-01-2013 10:18 AM |