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