Unlike previous versions of VB, the .NET image control doesn't support viewing files such as Word docs, and Microsoft recommend using Internet Explorer. This approach works fine.

However, having viewed the Word doc, I wish to upload it as a BLOB to SQL Server. When I do so, mscorlib sends a message to say that the file is already in use by another process. The exception occurs when the FileStream object managing the upload tries to open the file - the FileStream is set to open for read only. If I don't view the Word doc before uploading it, everything works fine hence the IE rendering engine must be putting a read lock of some sort on the file.

I've tried navigating away either to about:blank or to another Word doc, but the lock still occurs. I've tried to close down the browser by setting it to Nothing - same result. Even using the Marshal class to close down the COM object via its wrapper doesn't work as it insists that I'm doing an illegal cast.

Any ideas how to get around the lock?