oWord.Quit release oWordBut for your situation, where you need to release a oWord reference when 1426 happens, you might try something like this (try a test with your "oWord" reference declared public):
procedure MyErrorTrap(merror, mess, mess1, mprog, mlineno) ON ERROR * error messagebox or capture dialog here if merror=1426 on Error oWord=.NULL. oWord=getobject(,'Word.Application') if isnull(oWord) * Nothing can be done, Windows does not have a reference else * A reference exists oWord.Quit release oWord endif && IsNull(oWord) endif &&merror=1426 on error do myErrorTrap with merror, mess, mess1, mprog, mlineno endprocI haven't tested this and am just suggesting one approach you might try; if, indeed, we are on the same page regarding this issue.