I guess one way to do it is like this, is this the best way though?
''' <summary>
''' Check if a file is locked or open for editing
''' </summary>
''' <param name="filePath"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function ISFileLockedForWriting(ByVal filePath As String) As
Boolean
Dim result As Boolean = False
Try
Using fs As System.IO.Stream = IO.File.Open(filePath, IO.FileMode.Open,
IO.FileAccess.Write, IO.FileShare.None)
fs.Close()
result = False
End Using
Catch ex As Exception
result = True
End Try
Return result
End Function
"Smokey Grindle" <no****@dontspamme.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I need a way to tell if a program such as word or excel has a document it
locked (open for editing). Is there any way to do this in VB.NET? All I
need is a its open for editing or not response thats all... thanks!