abdulbadii Posted January 19, 2019 Posted January 19, 2019 I tried to replace 'the' and 'this' with 'that' by using VB Regex feature on Word upon 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. Any idea, how to solve it? Sincere help would really be appreciated
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now