J
Joe
I can't figure out the format for a sub to delete every word that has some underlining in it. I can't figure it out because I need to find each underline and then delete the whole word containing it.
Here's my lame code so far I pieced together reading the forum:
Sub DeleteUnderline()
'
' DeleteUnderline Macro
'
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Font.Underline = wdUnderlineSingle
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWildcards = True
.MatchWholeWord = False
.MatchSoundsLike = False
.MatchAllWordForms = False
While .Execute
oRng.Words(1).Delete
Wend
End With
End Sub
Submitted via EggHeadCafe - Software Developer Portal of Choice
Updated: Production Exception Handling For Dummies 101
http://www.eggheadcafe.com/tutorial...5c-a3f5b2184aa5/updated-production-excep.aspx
Here's my lame code so far I pieced together reading the forum:
Sub DeleteUnderline()
'
' DeleteUnderline Macro
'
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Font.Underline = wdUnderlineSingle
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWildcards = True
.MatchWholeWord = False
.MatchSoundsLike = False
.MatchAllWordForms = False
While .Execute
oRng.Words(1).Delete
Wend
End With
End Sub
Submitted via EggHeadCafe - Software Developer Portal of Choice
Updated: Production Exception Handling For Dummies 101
http://www.eggheadcafe.com/tutorial...5c-a3f5b2184aa5/updated-production-excep.aspx