Check if a Word Document is Opened

Hello. Is there a way to check if a Word Document is opened by another user?

I’m pulling data from a database and outputting it to labels (in VB .NET). I noticed that the program will fail if someone has the file opened. Is there a way to check before the writing is attempted?

Thank you!

Hi
Thanks for your request. You can try using try/catch. For example see the following code.

try
{
    // Try to open document
    Document doc = new Document(@"Test194\in.doc");
    // process document
}
catch (IOException ex)
{
    // Do something
}

Best regards.

Okay. I wasn’t sure if there was another way or not. THanks for the reply!