Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2020, 07:08 AM
gmaxey gmaxey is offline Find/remove underline with specific color Windows 10 Find/remove underline with specific color Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

1. Find/remove underline with specific color?




2. Is there a way .... which underline color is <> wdColorAutomatic

Those are two separate questions.



Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.UnderlineColor = wdColorRed
    While .Execute
      oRng.Font.Underline = wdUnderlineNone
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub

Sub ScratchMacroII()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Font.Underline = True
    While .Execute
      If oRng.Font.UnderlineColor <> wdColorAutomatic Then
        oRng.Font.Underline = wdUnderlineNone
      End If
    Wend
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find/remove underline with specific color Remove white text background (keeping the font color and page color intact cc3125 Word 1 10-26-2015 06:44 PM
Find/remove underline with specific color VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM
Find instance of a word in a specific style and change its color hwg Word VBA 7 02-20-2014 10:59 PM
Find/remove underline with specific color remove color from find/replace? Cobb78 Word 1 05-26-2012 06:16 PM
How to remove the UNDERLINE from a hyperlink text? Learner7 PowerPoint 3 05-17-2010 09:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft