Thread: Trap Word Error
View Single Post
 
Old 05-07-2020, 12:08 PM
kjc kjc is offline Windows 10 Office 2019
Novice
 
Join Date: May 2020
Posts: 12
kjc is on a distinguished road
Default Trap Word Error

I'm running a Word macro from Outlook on a file that is an attachment to an email message. When Word is started, WordApp.visible is set to FALSE.

Today the routine quit working on one PC in our office. No error; it just stopped executing.

By changing WordApp.visible to TRUE, I was eventually able to discover that the code had stopped because of the following error in a dialog box that was open behind all other windows: "Document Caused a Serious Problem When It Was Opened Last Time". Once I found the message and clicked that it was OK to open the file, the rest of the code worked fine.

So here's my question: Is there a way to trap for this error in vba?
Reply With Quote