'引用FileSystemObject
Public Function IsOccupied(ByVal strFileName As String) As Boolean
Dim Fso As New FileSystemObject, strPath As String
strPath = Replace(LCase(strFileName), ".dwg", ".dw2")
If Fso.FileExists(strPath) = True Then
Fso.DeleteFile strPath
If Fso.FileExists(strPath) = True Then IsOccupied = True
End If
End Function