读书人

vb.net中怎的判断一个word/excel/powe

发布时间: 2013-01-18 10:22:42 作者: rapoo

vb.net中怎样判断一个word/excel/powerpoint文档是否关闭
vb.net中怎样判断一个word/excel/powerpoint文档是否关闭
[解决办法]


Private Function isopen(ByVal path_string As String) As Boolean
Try
Dim fs As New IO.FileStream(path_string, IO.FileMode.OpenOrCreate, IO.FileAccess.Read)
fs.Dispose()
Return False
Catch ex As Exception
Return True
End Try
End Function

'下面是调用方法:
If isopen("e:\1.doc") = True Then
MsgBox("打开")
Else
MsgBox("未打开")
End If

读书人网 >VB Dotnet

热点推荐