Application.CustomizationContext プロパティ (Word)

返すまたは、バー、ツールバー、およびショートカット キーを格納するへの変更] メニューの [テンプレートまたは文書を表す テンプレート または 文書 のオブジェクトを設定します。 値の取得と設定が可能です。

構文

expression. CustomizationContext

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

注釈

[ユーザー設定] ダイアログ ボックス ([ツール] メニュー) の [コマンド] タブにある [保存先] ボックスの値と対応します。

This example adds the ALT+CTRL+W key combination to the FileClose command. The keyboard customization is saved in the Normal template.

CustomizationContext = NormalTemplate 
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, _ 
 wdKeyAlt, wdKeyW), _ 
 KeyCategory:=wdKeyCategoryCommand, Command:="FileClose"

次の使用例は、 標準 ツール バーに [ファイル バージョン] ボタンを追加します。 コマンド バーのユーザー設定は、作業中の文書に添付されたテンプレートに保存されます。

CustomizationContext = ActiveDocument.AttachedTemplate 
Application.CommandBars("Standard").Controls.Add _ 
 Type:=msoControlButton, _ 
 ID:=2522, Before:=8

関連項目

Application オブジェクト

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

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