-
Macro for finding en dash surrounded by text without spaces
Hello,
I’m trying to create macro in Word that would find and highlight only following scenario:
anyText–anyText
(word, no space, en dash, followed by another word without space).
in fact, even that would be enough:
anyLetterEndingString–anyLetterStartingString
I need to be able to locate en dash when it's surrounded by text without spaces.
I will be very grateful for any tips, since I'm stuck...
----
Here's the last of my attempts, just for reference:
Sub Testt()
Set r = ActiveDocument.Range
With r.Find
.ClearFormatting
.Text = "(< *)(^0150)(* >)"
.MatchWildcards = True
Do While .Execute(Forward:=True) = True
r.HighlightColorIndex = wdPink
Loop
End With
End Sub
Best regards
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules