Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error 5449 - Find/replace

Status
Not open for further replies.

Greni

IS-IT--Management
Jan 12, 2005
3
DK
Hi

I got runtime error 5449 when trying to run
Find/replace fron VBA code in a word document?

AutoOpen()

Selection.Find Clearformatting
Selection.Find replacement.Clearformatting
With selection.find
.Text = $CustomerID
.Replacement.text = intCustomerID
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.Matchwildcards = False
.MatchSoundsLike
.MatchAllWordForms
.Forward = true
End With
Selection.find.execute Replace:=wdreplaceAll (Stops here)

Any help?

/Greni
 
if you copied the code:
Selection.Find replacement.Clearformatting

literally, then you need a Dot, as in:

Selection.Find.Replacement.Clearformatting

Code:
   .Text = $CustomerID
   .Replacement.text = intCustomerID

These are string variables? Because if they are not...

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top