Table of contents
TOC
折叠目录
展开目录

InvisibleApp.UndoEnabled 属性 (Visio)InvisibleApp.UndoEnabled Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

确定撤消信息是否保留在内存中。可读写。Determines whether undo information is maintained in memory. Read/write.

语法Syntax

表达式UndoEnabledexpression . UndoEnabled

表达式_一个表示InvisibleApp对象的变量。_expression A variable that represents an InvisibleApp object.

返回值Return Value

BooleanBoolean

注解Remarks

当 Microsoft Visio 启动时, UndoEnabled属性的值为True 。将UndoEnabled属性的值设置为False将中止撤消信息在内存中的集合并清除现有的撤消信息。When Microsoft Visio starts, the value of the UndoEnabled property is True . Setting the value of the UndoEnabled property to False discontinues the collection of undo information in memory and clears the existing undo information.

您应该尝试在执行的完整操作过程中使该属性保持其当前值。换句话说,使用类似以下结构的代码:You should attempt to maintain the property at its current value across the complete operation that you perform. In other words, use code structured like this:

blsPrevious = Application.UndoEnabled 
Application.UndoEnabled = False 

'Large operation here 
Application.UndoEnabled = blsPrevious 

示例Example

下面的 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用UndoEnabled方法来禁用然后再重新启用在 Visio 中的撤消行为。The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the UndoEnabled method to disable and then re-enable undo behavior in 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
© 2018 Microsoft