E
Elessvie
Hi, everyone!
I’m not a developer or professional programmer, just a budding amateur one
at best, wanting to learn more. (I am familiar with basic programming
concepts.) In trying to improve our lives here in Word, I searched for and
found the following code in a post in this discussion group and thought I'd
try it out. It would do exactly what we need, but the procedure doesn’t run
after being copied into a NewMacros module. Can anyone please help me, or
set me in the right direction to figure out why it won’t run? I get no error
messages.
We are using Word 2003 (11.8202.8132) SP2.
Any help or any feedback at all on this would be very very very appreciated.
Thank you!
-Lynne
Here’s the code:
Sub FindAndUnderlineTextInQuotes()
'Underlines text exclusive of the quotes marks
Set oRng = ActiveDocument.Content
With oRng.Find
.ClearFormatting
.Text = """<*>"""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
If oRng.Find.Found = True Then
With oRng
.MoveEnd Unit:=wdCharacter, Count:=-1
.MoveStart Unit:=wdCharacter, Count:=1
.Font.Underline = True
.Collapse wdCollapseEnd
End With
End If
Loop
End With
End Sub
I’m not a developer or professional programmer, just a budding amateur one
at best, wanting to learn more. (I am familiar with basic programming
concepts.) In trying to improve our lives here in Word, I searched for and
found the following code in a post in this discussion group and thought I'd
try it out. It would do exactly what we need, but the procedure doesn’t run
after being copied into a NewMacros module. Can anyone please help me, or
set me in the right direction to figure out why it won’t run? I get no error
messages.
We are using Word 2003 (11.8202.8132) SP2.
Any help or any feedback at all on this would be very very very appreciated.
Thank you!
-Lynne
Here’s the code:
Sub FindAndUnderlineTextInQuotes()
'Underlines text exclusive of the quotes marks
Set oRng = ActiveDocument.Content
With oRng.Find
.ClearFormatting
.Text = """<*>"""
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
If oRng.Find.Found = True Then
With oRng
.MoveEnd Unit:=wdCharacter, Count:=-1
.MoveStart Unit:=wdCharacter, Count:=1
.Font.Underline = True
.Collapse wdCollapseEnd
End With
End If
Loop
End With
End Sub