View Single Post
 
Old 09-06-2015, 07:33 AM
Michael007 Michael007 is offline Windows 7 64bit Office 2003
Novice
 
Join Date: Dec 2010
Posts: 18
Michael007 is on a distinguished road
Default Old macro in Word 2003 Do no work in Word2010

Hello every one,

I have a macro that used to work well. However, it seems to bug with my new Word 2010. Let me give a piece of the code:
Quote:
Application.ScreenUpdating = False

Dim strFind As String, strRep As String, a As Integer
strFind = strFind & "TEMISCAMINGUE,ABITIBI,PARENT - RESERVOIR GOUIN,MATAGAMI,WASKAGANISH"

strRep = strRep & "WBA,YVO,WPK,YNM,YKQ"

With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True
.Text = "^13"
.Replacement.Text = "^l"
.Execute Replace:=wdReplaceOne
.Text = "([^13]{2}[!^13]{1;})^13"
.Replacement.Text = "\1^l"
.Execute Replace:=wdReplaceAll
At the last line of the code, I receive the message "Error 5560". "text searched contains a criteria not valid"

Anybody has a clue?

Michael
Reply With Quote