Find and Replace doesnt work

J

Jack

If I use the find and replace command within Word to replace text including
text within a shape object) everything works.
But when I place the code in a vba module it doesnt find the text in any
shape objects.
My code is
ActiveDocument.Content.Select
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Year"
.Replacement.Text = "2007"
.Forward = True
.Wrap = wdFindAsk 'wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

Any suggestions would be appreciated
jack
 
J

Jack

Doug,,
Thank you very much. That is exactly what I was looking for. I had
actually been to that site searching but never came up with that article.
Thanks again
Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top