C
ctyrrell
I am experiencing a run-time error 4198 when comparing certain Word
documents using vba (from Access 2000 - automating Word 2000). In
general, I think it is caused when trying to compare documents that
have already been compared. My problem is that I cannot trap the error.
I have an On Error goto statement right before the doc.Compare filename
statement, but it does not go to the error handler when the error
occurs, instead presenting the 'Command failed' message to the User and
then showing the yellow highlight on the Compare command when the
'Debug' button is clicked. I have tried setting the DisplayAlerts to
each of the 3 different choices right before the Compare, all to no
avail. Behaviour remains the same. The same code works fine for many
other documents, but I want to gracefully be able to handle this
problem, even if it is only to log the error and move on to the next
file to be processed.
Any ideas on why I can't trap this error? Anything different I can do?
Any way I can detect if the file has already been compared, and thus
avoid comparing when it would cause this error?
Any help much appreciated, Thanks
Christine
documents using vba (from Access 2000 - automating Word 2000). In
general, I think it is caused when trying to compare documents that
have already been compared. My problem is that I cannot trap the error.
I have an On Error goto statement right before the doc.Compare filename
statement, but it does not go to the error handler when the error
occurs, instead presenting the 'Command failed' message to the User and
then showing the yellow highlight on the Compare command when the
'Debug' button is clicked. I have tried setting the DisplayAlerts to
each of the 3 different choices right before the Compare, all to no
avail. Behaviour remains the same. The same code works fine for many
other documents, but I want to gracefully be able to handle this
problem, even if it is only to log the error and move on to the next
file to be processed.
Any ideas on why I can't trap this error? Anything different I can do?
Any way I can detect if the file has already been compared, and thus
avoid comparing when it would cause this error?
Any help much appreciated, Thanks
Christine