Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-06-2015, 07:33 AM
Michael007 Michael007 is offline Old macro in Word 2003 Do no work in Word2010 Windows 7 64bit Old macro in Word 2003 Do no work in Word2010 Office 2003
Novice
Old macro in Word 2003 Do no work in Word2010
 
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
  #2  
Old 09-06-2015, 06:14 PM
macropod's Avatar
macropod macropod is offline Old macro in Word 2003 Do no work in Word2010 Windows 7 64bit Old macro in Word 2003 Do no work in Word2010 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,374
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

This is probably due to your new system using different regional settings! Change:
.Text = "([^13]{2}[!^13]{1;})^13"
to:
.Text = "([^13]{2}[!^13]{1;})^13"
or:
.Text = "([^13]{2}[!^13]@)^13"
The last version should work regardless of your regional settings.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Word 2007 macro to work in Word 2003 Kamaflage Word VBA 1 02-25-2015 11:40 PM
HTML Links do not work in MS Word 2003 mswny Word 20 10-11-2014 02:25 PM
Old macro in Word 2003 Do no work in Word2010 Word 2003 Macro problem running in Word 2010 norwood Word VBA 2 02-03-2014 06:49 PM
Old macro in Word 2003 Do no work in Word2010 Cross referencing does not work in word2010 alex2356 Word 1 06-13-2013 11:32 AM
Old macro in Word 2003 Do no work in Word2010 I created a survey in word 2003 but it does not work sqlcool Word 1 04-06-2012 03:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:49 AM.


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