AutoCAD正常退出保留自动保存文件
'在正常退出情况下也保留自动保存文件
Private Sub AcadDocument_BeginDocClose(Cancel As Boolean)
'On Error Resume Next
Dim File As String
Dim NewFile As String
'系统自动保存的文件名
File = ThisDrawing.GetVariable("SAVEFILE")
If File = "" Then Exit Sub
Dim FileName As String
FileName = GetFileName(File)
NewFile = GetPath & "DWG_Back\" & FileName
NewFile = Left(NewFile, Len(NewFile) - 4) & "_TC.dwg"
If Dir(GetPath & "DWG_Back\") = "" Then
MkDir GetPath & "DWG_Back\"
End If
Name File As NewFile '重新命名一个文件、目录、或文件夹。
End Sub
Private Sub AcadDocument_BeginDocClose(Cancel As Boolean)
'On Error Resume Next
Dim File As String
Dim NewFile As String
'系统自动保存的文件名
File = ThisDrawing.GetVariable("SAVEFILE")
If File = "" Then Exit Sub
Dim FileName As String
FileName = GetFileName(File)
NewFile = GetPath & "DWG_Back\" & FileName
NewFile = Left(NewFile, Len(NewFile) - 4) & "_TC.dwg"
If Dir(GetPath & "DWG_Back\") = "" Then
MkDir GetPath & "DWG_Back\"
End If
Name File As NewFile '重新命名一个文件、目录、或文件夹。
End Sub
[本日志由 tiancao1001 于 2008-11-15 11:40 AM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |