Document.RedoActionsAvailable 属性 (Publisher)
返回恢复堆栈上可用操作的数量。 只读 Long。
语法
表达式。RedoActionsAvailable
表达 一个代表 Document 对象的变量。
返回值
长型
示例
下面的示例将一个包含文本框架的矩形添加到当前出版物的第四页。 设置文本框架的某些字体属性和文本。 然后进行判断以确定文本框架中的字体是否为 Courier。 如果是,则使用 Undo 方法并将 UndoActionsAvailable 属性的值作为参数进行传递,以指定撤消以前的所有操作。
Redo 方法再减 2 作为参数传递的 RedoActionsAvailable 属性的值用于恢复所有除了最后两个动作。 在文本框架中,除了新文本之外的文本指定新字体。
此示例假定活动文档至少包含四页。
Dim thePage As page
Dim theShape As Shape
Dim theDoc As Publisher.Document
Set theDoc = ActiveDocument
Set thePage = theDoc.Pages(4)
With theDoc
With thePage
Set theShape = .Shapes.AddShape(msoShapeRectangle, _
75, 75, 190, 30)
With theShape.TextFrame.TextRange
.Font.Size = 12
.Font.Name = "Courier"
.Text = "This font is Courier."
End With
End With
If thePage.Shapes(1).TextFrame.TextRange.Font.Name = "Courier" Then
' The Undo method specifies that all undoable actions be undone.
.Undo (.UndoActionsAvailable)
' The Redo method uses RedoActionsAvailable - 2 to specify that
' all redoable actions be redone except for the last two actions.
' The last two actions that are not redone are setting
' .Font.Name and .Text.
.Redo (.RedoActionsAvailable - 2)
With theShape.TextFrame.TextRange
.Font.Name = "Verdana"
.Text = "This font is Verdana."
End With
End If
End With
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈