Visio) (Document.UndoEnabled 屬性

決定是否將復原資訊保留在記憶體中。 讀取/寫入。

語法

運算式。UndoEnabled

運算式 代表 Document 物件的變數。

傳回值

布林值

註解

當 Microsoft Visio 啟動時,UndoEnabled 屬性的值是 True。 將 UndoEnabled 屬性的值設定為 False 會停止在記體中收集復原資訊並會清除現有的復原資訊。

您應該嘗試在執行的完整作業中將屬性維持在其目前值。 換句話說,請使用如下結構的程式碼:

blsPrevious = Application.UndoEnabled 
Application.UndoEnabled = False 
 
'Large operation here 
Application.UndoEnabled = blsPrevious 

範例

下列Microsoft Visual Basic for Applications (VBA) 巨集 示範如何使用 UndoEnabled 方法在 Visio 中停用然後重新啟用復原行為。

Public Sub UndoEnabled_Example() 
 
 'Disable undo 
 Application.UndoEnabled = False 
 
 'Draw three shapes. 
 ActivePage.DrawRectangle 1, 2, 2, 1 
 ActivePage.DrawOval 3, 4, 4, 3 
 ActivePage.DrawLine 4, 5, 5, 4 
 
 'Enable undo. 
 Application.UndoEnabled = True 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。