Part of the code you posted looks correct, but itβs not enough for me to reproduce the behavior you described. But...
I have a strong suspicion, and the answer is that you cannot completely suppress messages in Word. . It was developed as a user interactive application, and the DisplayAlerts parameter is a little suggestion to skip or skip. Some errors look as if they can be freed from the specified alert setting and displayed anyway. For example, I saw how spelling and grammar errors behave as before.
It is best to try to anticipate errors that may occur and not generate them. In your case, you should check if the document you are about to open is open. I'm not sure why you ever created this error (you catch the error and then look for an existing copy of the document to work on it, or how does your code continue to work?), But before you start executing the corresponding code, it should be pretty just insert a few protective sentences.
source share