次の方法で共有


ShowToolbar マクロ アクション

適用先: Access 2013、Office 2013

You can use the ShowToolbar action to display or hide a group of commands on the Add-Ins tab.

注:

  • The ShowToolbar action does not affect shortcut menus.
  • このアクションは、データベースが信頼されていない場合には許可されません。

Setting

"ShowToolbar/ツールバーの表示" アクションの引数は次のとおりです。

アクションの引数

説明

Toolbar Name/ツール バー名

表示と非表示を切り替える、[アドイン] タブ上のコマンド グループの名前を指定します。 [マクロ ビルダー] ウィンドウの [アクションの引数] セクションにある [ツール バー名] ボックスには、このアクションの影響を受ける使用可能なグループがすべて表示されます。 この引数は省略できません。 ライブラリ データベースで "ShowToolbar/ツール バーの表示" アクションが定義されているマクロを実行すると、この名前のグループが、最初にライブラリ データベースで検索され、次にカレント データベースで検索されます。

Show

グループを表示するかどうか、また、どのビューで表示または非表示にするかを指定します。 既定値は [はい] です (常にグループを表示します)。 [ はい ] を選択すると常にグループが表示されます。適切なフォームまたはレポートがアクティブな場合にのみグループを表示する 場合は [適切な場所 ] を、グループを常に非表示にするには [いいえ] を選択できます。

注釈

マクロでこのアクションと条件式を組み合わせて使用すると、特定の条件に応じてグループの表示と非表示を切り替えることができます。

If you want to show a particular group on just one form or report, you can set the OnActivate property of the form or report to the name of a macro that contains a ShowToolbar action to show the group. Then set the OnDeactivate property of the form or report to the name of a macro that contains a ShowToolbar action to hide the group.

The built-in toolbars are not available to display or hide by using this action if you set the AllowBuiltInToolbars property to False (0) in a Visual Basic for Applications (VBA) module, or if you set the Allow Built-in Toolbars option to False in VBA by using the SetOption method.

To run the ShowToolbar action in a VBA module, use the ShowToolbar method of the DoCmd object.