How can I see if drawing is opened by another user ?

How can I see if drawing is opened by another user ?

Anonymous
Not applicable
193 Views
1 Reply
Message 1 of 2

How can I see if drawing is opened by another user ?

Anonymous
Not applicable
How can I see if a drawing is opened by another user ?
I'm using VB and I want to create a message if someone is opening a file which is already in use.

Thanks,
Ivo
0 Likes
194 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Here is a function that I use.

 

Private Function FileAvailable(FileName As String)
As Boolean
  Dim hFile As Long
  hFile = FreeFile
  On
Error Resume Next
  Open FileName For Binary Lock Read Write As
#hFile
  FileAvailable = (Err.Number = 0)
  Close
hFile
  Err.Clear
End Function

 

In your code you would call it like:

 

If FileAvailable(strFullPathToDrawing)
Then

   ' Do stuff with the
drawing

End If

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
How
can I see if a drawing is opened by another user ?
I'm using VB and I want
to create a message if someone is opening a file which is already in use.

Thanks,
Ivo

0 Likes