-
How to check a file is opened or not ?
[Originally posted by bond]
how to check a file eg a word file is opening ??
thx for your reply
-
Re:How to check a file is opened or not ?
[Originally posted by John Citizen]
Here is a generic function from my library that i use to see if a file exists. It also will tell you if a file is opened. This is because if you try and open a file and it is already open... you get an error.
Paste this function in your code and it will return a true if the file is not opened and a false if the file is opened.
Function DoesFileExist(rsFilename As String) As Boolean
ÿ ÿ Dim nFile As Integer
ÿ ÿ On Error GoTo err_DoesFileExist
ÿ ÿ
ÿ ÿ nFile = FreeFile
ÿ ÿ Open rsFilename For Input As #nFile
ÿ ÿ ÿ ÿ DoesFileExist = True
ÿ ÿ
exit_DoesFileExist:
ÿ ÿ Close nFile
ÿ ÿ Exit Function
err_DoesFileExist:
ÿ ÿ DoesFileExist = False
ÿ ÿ Resume exit_DoesFileExist
End Function
Jaie deMaagd
Neocom IT
www.neocomit.com.au
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|