Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-17-2025, 08:03 AM
Ddadoo57 Ddadoo57 is offline problem with capturing group in findText/ReplaceWith Windows 11 problem with capturing group in findText/ReplaceWith Office 2021
Advanced Beginner
problem with capturing group in findText/ReplaceWith
 
Join Date: Feb 2023
Posts: 90
Ddadoo57 is on a distinguished road
Default problem with capturing group in findText/ReplaceWith

Hello, I have the code below but since a few days the reuse of the group in parenthesis is misinterpreted in the ReplaceWith. For example if I have the following text “...Hello” I will get “...H ello”, with a space after the H instead of before.



If I go into word and do Ctrl+H, check wildcards and paste in search field “^0133([A-Za-zÀ-ÖØ-öø-ÿ0-9])” and replace field “... \1” I get the same error.

Has a parameter in my VBA changed or in Word these days? I've reinstalled Word365 twice, I've done the Office365 updates. It seems to me that this problem appeared after the last Windows 11 update.

Code:
Do 
    positionInitial = text.start
    text.Find.ClearFormatting
    text.Find.Replacement.ClearFormatting
    text.Find.MatchWildcards = True
    texte.Find.Execute findText:=“^0133([A-Za-zÀ-ÖØ-öø-ÿ0-9])”, ReplaceWith:=“... \1”, Replace:=2
Loop While texte.start <> positionInitial

Last edited by Ddadoo57; 02-18-2025 at 02:39 AM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with capturing group in findText/ReplaceWith Find and Replace not capturing entire line Steve Kunkel Word VBA 7 04-22-2021 10:00 AM
problem with capturing group in findText/ReplaceWith Capturing numbered headings jbvalen Word VBA 5 05-04-2017 05:03 PM
problem with capturing group in findText/ReplaceWith Capturing Redirected URL with macro souravkp Word VBA 1 07-11-2015 09:34 PM
problem with capturing group in findText/ReplaceWith Capturing addresses into contacts lordnacho Outlook 1 11-01-2010 06:05 PM
time capturing aligahk06 Excel 0 04-18-2010 11:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:41 PM.


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