以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  如何用代码判断一个office文件是否打开或关闭?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=29304)

--  作者:lihe60
--  发布时间:2013/3/4 11:33:00
--  如何用代码判断一个office文件是否打开或关闭?
如题
--  作者:狐狸爸爸
--  发布时间:2013/3/4 11:45:00
--  

        Try
            Dim fs As System.IO.Stream = System.IO.File.Open("c:\\data\\123.xls", IO.FileMode.Open, IO.FileAccess.Write)
            fs.Close()
            MessageBox.Show("没有打开")
        Catch ex As Exception
            MessageBox.Show("已经打开啊")
        End Try

--  作者:飞
--  发布时间:2013/3/4 11:47:00
--  
http://www.foxtable.com/help/topics/2126.htm
--  作者:狐狸爸爸
--  发布时间:2013/3/4 11:50:00
--  
惭愧,我自己都不知道提供了这个函数