Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2023, 09:19 AM
vivka vivka is offline VBA Quotes Before Punctuation Windows 7 64bit VBA Quotes Before Punctuation Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

I didn't check this on footnotes, but it's much faster:

For Each myRng In ActiveDocument.StoryRanges
Do
With myRng
Do
With .Find
.MatchWildcards = True
.text = "[,;.:?]" & "[«‹›»" & Chr(39) & Chr(34) & Chr(146) & Chr(148) & "]"
.Replacement.text = ""
.Wrap = wdFindStop
.Execute
End With
If .Find.found Then


myRng.InsertBefore myRng.Characters.Last
myRng.Characters.Last.Delete
Else: Exit Do
End If
myRng.Collapse 0
Loop
End With
Set myRng = myRng.NextStoryRange
Loop Until myRng Is Nothing
Next myRng
Reply With Quote
  #2  
Old 09-23-2023, 09:35 AM
RobiNew RobiNew is offline VBA Quotes Before Punctuation Windows 10 VBA Quotes Before Punctuation Office 2016
Competent Performer
VBA Quotes Before Punctuation
 
Join Date: Sep 2023
Posts: 208
RobiNew is on a distinguished road
Smile

It is indeed much faster. And it works also in the footnotes. I think it's perfect. Many, many thanks!
Reply With Quote
Reply

Tags
characters, quotes, swap



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem when changing single-quotes to double-quotes Lup Word 14 02-14-2020 02:46 AM
Curly Smart Quotes Switch to Straight Smart Quotes in New Chapters TheWriterBloke Word 3 03-29-2019 03:11 AM
VBA Quotes Before Punctuation How to replace straight quotes with smart quotes in existing document PABwriter Word 4 05-27-2016 03:36 PM
Changing dumb quotes to smart quotes Reisende Word 2 05-02-2016 08:56 PM
VBA Quotes Before Punctuation Changing single-quotes to double-quotes Bobosmite Word 5 04-15-2013 06:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft