check if file is open

G

Guest

hi,

i have an open & delete btn. onclick of open as visio drawing opens in visio
& onclick of delete the drawing gets deleted from the filesystem. The problem
is i am unable to perform these actions if the file is already opened in
another instance of visio. how do i check if it's already opened and then
throw an error msg?

thanks
 
K

Kevin Spencer

Use Try/Catch.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
G

Guest

Hi,

I am not using the filestream to open the file, i am using visio's object to
open the file. Do u think the try/catch would be the only resolution to check
if the file is already opened?

If File.Exists(filename) Then
visioApp = CreateObject("visio.application")
visioDocs = visioApp.Documents
visioDoc = visioDocs.OpenEx(filename, 32)
end if

thanks
 
K

Kevin Spencer

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top