Hi Tom,
I've recorded a macro as you've suggested from word. Here it is down below.
Two things about this macro which I couldn't figure out how to cope with:
After the replacements I need to save this document with its original
(previous) document name. But MSWord didn't give me the option while I was
working with the macro. So I had to give it a "new" name and save it. This
is why it was named "example_1.doc" before saving. Was it possible to give
it its previous name (overwriting) ?
Secondly. Although after creating the macro I assigned it to the Document1
file (and not to the original normal.dot of MSWord) now when I open a new
blank document to work on something else it contains some elements in the VB
editor modules (beleive that they are left overs from my previous
work)...How can I get rid of that?. I'd be very happy if you can comment.
Thanks for your previous help again. And here goes my macro
_______________________________________
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 08.06.2004 by Martyn
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "martyn"
.Replacement.Text = "wmartyn"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveDocument.SaveAs FileName:="example_1.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
End Sub
__________________________________________________________