UndoRecord.CustomRecordName プロパティ (Word)

すべてのユーザー設定の元に戻すアクションが完了したときに、元に戻すスタックに表示されるエントリを指定する文字列型 ( String ) の値を返します。 値の取得のみ可能です。

構文

CustomRecordName

UndoRecord オブジェクトを表す変数。

注釈

ユーザー設定の元に戻すレコードが他のユーザー設定の元に戻すレコードの中にネストされている場合、このプロパティは、ユーザー設定の元に戻すアクションをすべて完了した後に元に戻すスタックに表示される文字列を指定します。 StartCustomRecord メソッドに対する複数の呼び出しがネストしている場合、このプロパティでは最初の呼び出しで指定された文字列が返されます。 アクティブなアクションがない場合、このプロパティは空の文字列を返します。

次のコード例では、入れ子にされたユーザー定義の undo レコードを作成します。 コードが完了すると、元に戻す] の各レコードについてのメッセージは、作業中の文書に挿入され、元に戻すスタックにエントリとして表示されます「まず」です。

注:

[!メモ] このコード例を実行するのには、コード ファイルを配置の Visual Basic for Applications の ThisDocumentプロジェクト エクスプ ローラー。

Sub WalkUndoRecordStack()
Dim objUndo As UndoRecord
 
'Create UndoRecord object
Set objUndo = Application.UndoRecord
 
'Begin first custom record
objUndo.StartCustomRecord ("First call")
    'Begin nested second custom record
    objUndo.StartCustomRecord ("Second call")
        'Begin nested third undo record
        objUndo.StartCustomRecord ("Third call")
            'Message for the third call is written first to the document
            Me.Content.InsertAfter "Third call. "
            'End third custom record
        objUndo.EndCustomRecord
        'Message for the second call is written second to the document
        Me.Content.InsertAfter "Second call. "
    'End second custom record
    objUndo.EndCustomRecord
    'Message for first call is written third to the document
    Me.Content.InsertAfter "First call. "
'End first custom record
objUndo.EndCustomRecord

Set objUndo = Nothing
End Sub

関連項目

UndoRecord オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。