共用方式為


Application.UndoEnabled property (Visio)

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

語法

表情復原啟用

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