Visio (的 Application.UndoEnabled 屬性)

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

語法

運算式UndoEnabled

expression 代表 Application 物件的變數。

傳回值

布林值

註解

當 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 支援與意見反應