共用方式為


Document.RedoActionsAvailable 屬性 (Publisher)

在取消復原堆疊傳回可用的動作數目。 唯讀的 Long

語法

運算式RedoActionsAvailable

表達 代表 Document 物件的變數。

傳回值

Long

範例

下列範例會在使用中出版物的第四頁新增含有文字框的矩形。 某些字型屬性及文字框的文字已經設定。 接著測試文字框中的字型是否為 Courier。 如果是,會使用 Undo 方法,同時傳入 UndoActionsAvailable 屬性值做為參數,將之前所有動作指定為復原。

Redo 方法然後搭配 RedoActionsAvailable 屬性值減 2 以參數方式傳遞至取消復原但不包括最後兩個的所有動作。 新的字型會指定文字圖文框,除了新的文字中的文字。

本範例假設使用中檔至少包含四頁。

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