![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I tried to replace 'the' and 'this' with 'that' by using VB Regex feature on Word with the applied strings (ie. document) having font size mostly 10 and 18 for titles, but it resulted in entire strings having font size 18, although the regex seems works correctly (I can't read well)
Sub Regex_Replace Dim re As Object, match As Object, matches As Object Set re = CreateObject("VBScript.RegExp") With re .Global = True .IgnoreCase = True .Pattern = "(th)(e|is)\b" ActiveDocument.Range.Text = .Replace(ActiveDocument.Range.Text, "$1at") End With End Sub I can't read the document now as it got messed up and screwed with crammed words with font size 18. How to solve it? Sincere help would really be appreciated |
Tags |
regex |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
scorpio_oz | Word | 7 | 04-06-2016 06:02 AM |
Macro help regex | subspace3 | Word VBA | 1 | 10-15-2014 09:53 AM |
![]() |
gasyoun | Word VBA | 9 | 04-12-2013 04:15 PM |
![]() |
abrad99 | Office | 5 | 05-07-2011 09:55 PM |
Regex in Word: Replaced strings are in disorder | chgeiselmann | Word | 0 | 04-26-2009 11:33 AM |