![]() |
|
#3
|
||||
|
||||
|
Search for br.[!0-9] with the wildcard option set. http://www.gmayor.com/replace_using_wildcards.htm
Code:
Sub Replace_br()
Dim orng As Range
Set orng = ActiveDocument.Range
With orng.Find
Do While .Execute(FindText:="br.([!0-9])", ReplaceWith:="bread\1", MatchWildcards:=True)
orng.Collapse 0
Loop
End With
lbl_Exit:
Set orng = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com Last edited by gmayor; 10-23-2016 at 11:32 PM. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA code to compile one document based on multiple search terms
|
Hoxton118 | Word VBA | 4 | 04-04-2021 06:02 AM |
| Search Replace Code | BolligeA1 | Word | 8 | 02-22-2016 12:32 PM |
| Search and Replace vba Word 2003 | tariqaleed2 | Word VBA | 9 | 08-19-2014 03:34 AM |
| Search and replace/insert HTML code into Master File using tags | dave8555 | Excel | 2 | 02-23-2014 03:51 PM |
WORD: Rtf and search-replace (regexp/fonts)
|
seteshpl | Word | 1 | 09-06-2011 01:35 AM |