View Single Post
 
Old 09-28-2023, 09:17 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default

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!


Quote:
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 'Ranges = testo e note
mStory.Find.Execute FindText:="^#" & Chr(150) & "^#", ReplaceWith:=Chr$(45), Replace:=wdReplaceAll
Next mStory
Set mStory = Nothing
End Sub
Reply With Quote