I want to check whether a given text File is Already Opened or not. I am using Visual Basic 6.0 in the Windows XP OS.
I am using the following code. It works for .doc, .xls and .mdb. But its not working for .txt file type
Expand|Select|Wrap|Line Numbers
- Public Function IsFileOpen(FileName As String) As Boolean
- On Error GoTo ErrHandler
- Open FileName For Binary Access Read Lock Read As #1
- MsgBox Input$(LOF(1), #1)
- Close #1
- Exit Function
- ErrHandler:
- MsgBox "File is Already Opened"
- End Function
Can Any body give me the solution for this?
Thanks and Regards
Vijay. R