View Single Post
 
Old 09-29-2023, 09:30 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 293
vivka is on a distinguished road
Default

Hi, RobiNew! If undersatand correctly what you want, try the following. But note that m-dash has code 151 and n-dash has code 150.
Code:
Sub DASHES()
'Testo e Note: Sostituisce m-dash con n-dash

Dim mStory As range 'Nel testo e nelle note
Dim mRange As range
  For Each mStory In ActiveDocument.StoryRanges
    mStory.Find.Execute FindText:="([0-9])" & Chr(151) & "([0-9])", _
    ReplaceWith:="\1" & Chr(150) & "\2", _
    MatchWildcards:=True, _
    Replace:=wdReplaceAll
  Next mStory
End SUb
Reply With Quote