View Single Post
 
Old 09-28-2023, 09:15 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Question Replace dashes between two digits without using Selection

Hi! I'm trying to replace m-dashes with n-dashes between two digits (text and footnotes) without using Selection. How can I modify this code? Thanks!


Sub DASHES()
Dim mStory As Range
Dim mRange As Range
For Each mStory In ActiveDocument.StoryRanges
mStory.Find.Execute FindText:="^#" & Chr(150) & "^#", ReplaceWith:=Chr$(45), Replace:=wdReplaceAll
Next mStory
Set mStory = Nothing
End Sub
Reply With Quote