Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 07-23-2015, 06:14 PM
RickLegrand RickLegrand is offline Replace a random character with the same character Windows 8 Replace a random character with the same character Office 2013
Novice
Replace a random character with the same character
 
Join Date: Jul 2015
Location: São Paulo, Brazil
Posts: 4
RickLegrand is on a distinguished road
Default

I really don't know, Paul. As I said before, I'm totally illiterate in VBA. Programming is for the young and adventurous ones, I'm too old for learning now. All I know of macros is using them. I was simply copying and trying them as per the instructions from the post you sent. To follow Robert's idea I first tested it and later I used the Record Macro button and executed the procedure by hand. And now the macro works right. Here is the code Word recorded automatically:

Sub CleanUpPDFText2()
'
' CleanUpPDFText2 Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(^13)([a-z])"
.Replacement.Text = "^32\2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

_______________
Cheers
Rick
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace a random character with the same character How can select from a specific character to another character mohsen.amiri Word 2 02-19-2015 11:38 PM
Wildcard Find/Replace deletes extra character Cosmo Word 1 06-20-2014 08:49 AM
Replace a random character with the same character Character based Search and Replace font size anacond11 Word 2 08-08-2013 08:10 AM
Is it possible to include a newline character in the replace text desgordon Word 2 09-14-2012 02:28 AM
Replace a random character with the same character Using replace to make a word bold and its proceeding character. bostonboi Word 1 01-16-2011 01:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:10 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