Düzenle

Aracılığıyla paylaş


Document.AutoRecover property (Visio)

Determines whether an open document that has unsaved changes is copied when automatic recovery is enabled. Read/write.

Syntax

expression.AutoRecover

expression A variable that represents a Document object.

Return value

Boolean

Remarks

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. If you don't want a document to be recovered, set its AutoRecover property to False. The AutoRecover property is not saved with a document and must be set each time the document opens.

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.

  • 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 "<file name> (Recovered)" in the document's title bar.

  • If there is no recovery file, Visio opens the last saved copy of the document.

You must still save changes to recovered documents before Visio closes. If you don't save recovered documents, changes are discarded, as in any unsaved document.

Example

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.