salvelinus
Oct 21st, 2004, 08:00 AM
The code below is in a module that creates a Word doc in Access. The first line throws an error "Object does not support this action" on my machine and on a machine that had an Office 2000 re-install. I've checked the references on machines that it works on and machines it doesn't, and they're the same. Any idea how to get it to work on all? Thanks.
WordObj.Selection.Find.Replacement.ClearFormatting 'error here
With WordObj.Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
WordObj.Selection.Find.Execute Replace:=wdReplaceAll
WordObj.Selection.Find.Replacement.ClearFormatting 'error here
With WordObj.Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
WordObj.Selection.Find.Execute Replace:=wdReplaceAll