Srivani
Srivani

Reputation: 19

How to check the word document is already opened or not.?

In my application,i am creating the word document using vb.net.if i close the application and running again and open the same document..but the document is already opened,how to check the word document is already opened or not..?

Upvotes: 0

Views: 1203

Answers (1)

Palak.Maheria
Palak.Maheria

Reputation: 1515

try this:

  Dim p() As Process = Process.GetProcessesByName("WinWord")

    If p.Count = 0 Then

       ' No word instance opened

    Else

       ' Any Word instance opened

  End If

Upvotes: 1

Related Questions