Document.AutoRecover 属性 (Visio)Document.AutoRecover Property (Visio)

确定是否启用自动恢复复制包含未保存更改打开的文档。Determines whether an open document that has unsaved changes is copied when automatic recovery is enabled. 为可读/写属性。Read/write.

语法Syntax

expressionexpression. AutoRecover

_表达式_一个代表Document对象的变量。expression A variable that represents a Document object.

返回值Return value

布尔值Boolean

备注Remarks

如果自动恢复已启用 (如果Application.AutoRecoverInterval属性为大于 0),将所有文档已打开,且尚未保存的更改都复制到临时文件。If automatic recovery is enabled (if the Application.AutoRecoverInterval property is greater than 0), all documents that are open and have unsaved changes are copied into temporary files. 如果您不希望要恢复文档,则将其AutoRecover属性设置为FalseIf you do not want a document to be recovered, set its AutoRecover property to False. AutoRecover属性不与文档一起保存,并且必须设置每次打开文档。The AutoRecover property is not saved with a document and must be set each time the document opens.

当 Microsoft Visio 在异常终止后启动并确定已启用自动恢复时,它将尝试打开在终止时已打开的所有文件。When Microsoft Visio is launched after an abnormal termination and determines that automatic recovery was enabled, it attempts to open all files that were open at termination.

  • 如果没有恢复文件的晚于上次保存的文件的副本,Visio 将打开恢复的文件,并显示名称" (恢复)"的文档的标题栏中。If there is a recovery file that is more recent than the last saved copy of the file, Visio opens the recovered file and displays the name " (Recovered)" in the document's title bar.

  • 如果没有恢复文件,Visio 将打开上次保存的文档副本。If there is no recovery file, Visio opens the last saved copy of the document.

Visio 关闭之前,仍必须将更改保存到恢复的文档。You must still save changes to recovered documents before Visio closes. 如果您不保存恢复的文档,将放弃更改,如任何未保存的文档中所示。If you do not save recovered documents, changes are discarded, as in any unsaved document.

示例Example

此 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用AutoRecover属性禁用特定文档的自动恢复。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the AutoRecover property to disable automatic recovery for a particular document.

 
Private Sub Document_DocumentOpened(ByValdoc As IVDocument) 
  
    'Do not recover this document 
    ThisDocument.AutoRecover = False 
 
End Sub