<pre>I'm creating a Word document from EXCEL and i don't have problems in that. The real problem is using replace. Always creates an error in Excel and it must be closed. I'm looking for strings in the form of $%'word'%$.
Here's the code:
Sub replace(doc As Word.Document)
With doc.Content.Find
.Text = "$%Registrador%$"
.Replacement.Text = ":O"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute replace:=wdReplaceAll
End With
End Sub
I also need some sort of protection just in case the word i'm looking isn't there. Any idea?
</pre>