Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 06-30-2019, 01:06 AM
macropod's Avatar
macropod macropod is offline Find and replace text with wildcards Windows 7 64bit Find and replace text with wildcards Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As I said in post #12, you need todo an ordinary Find/Replace before the wildcard Find/Replace. Therefore, you would need to use:
Code:
With wdDoc
  .ConvertNumbersToText (wdNumberAllNumbers)
  With .Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Format = False
    .Wrap = wdFindContinue
    .MatchWildcards =False
    .Text = "^w^p"	
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
    .MatchWildcards = True
But this line is invalid:


Code:
.Text = "([0-9]{1,})[!^13]@| ([A-Z]{2}_[A-Z0-9^13]{8,9}>)^13"^p"
especially the ^p" ending. For starters, you can't use ^p for a wildcard Find and the " introduces yet another error, since you already have a terminating " before the ^p.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
wildcards, word macros

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace text with wildcards Dissecting a hyperlink with Find Replace Wildcards WeyldFalcon Word 4 11-15-2016 12:48 PM
Using wildcards in Find/Replace to change font/case angie450 Word 2 05-26-2016 11:09 AM
Using wildcards how do I Find and Add to, not replace Stargehzer Word 3 01-25-2016 09:14 PM
Find & Replace: Wildcards (except this pattern) tinfanide Word 6 01-26-2014 06:39 AM
wildcards in find & replace to reverse word order jeffk Word 3 11-11-2012 01:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:28 PM.


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