PDA

Click to See Complete Forum and Search --> : Object does not support..


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

Ecniv
Oct 21st, 2004, 08:41 AM
objWord.objDoc.Selection ???
Or you need a selection to start with?

You shouldn't be using hte selection object anyway ;) unless its from a user selection befor eyou call your macro.


Vince

salvelinus
Oct 21st, 2004, 10:20 AM
Thanks, but I didn't write the code. It'd be a major project to redo it all.
Anyway, it appears to be a service pack issue. When Access was installed yesterday, it was updated with all the service packs and updates. We did a repair today with the pre-SR1 Office 2000 cd, and the problem is - apparently - fixed.