Hmmm,

I recall discussing this with one of my development team a very long time ago.

I believe that you have to use the FileShare enumerator and specify Read or ReadWrite. If I remember correctly the default is None?

I also remember that diagrams had to be handled differently because they were image/bitmap class files. I did a quick Google and found this:

What's clear to me is that the Image and/or Bitmap class leave a file handle open after the bitmap is loaded. Code like this will always fail with a "generic error" exception:

Dim bmp As Image = Bitmap.FromFile("c:\temp\test2.bmp")
bmp.Save("c:\temp\test2.bmp")

And this code works:

Dim bmp As Image = Bitmap.FromFile("c:\temp\test2.bmp")
Dim cpy As New Bitmap(bmp)
bmp.Dispose()
cpy.Save("c:\temp\test2.bmp")

The Dispose call is critical, that seems to actually close the file handle.
It certainly can be done as I distinctly remember using MS Word and it would warn you if someone else had a file open for editing and actually offered to make a copy of it for you.

As you gave a .txt file as an example I just ran a little experiment opening the same file in both notepad and wordpad. I could edit it in both at the same time...............last file saved "won"