次の方法で共有


SaveObject マクロ アクション

適用先: Access 2013、Office 2013

You can use the SaveObject action to save either a specified Access object or the active object if none is specified. You can also save the active object with a new name in some cases (this functions the same as the Save As command on the Quick Access Toolbar).

注:

このアクションは、データベースが信頼されていない場合には許可されません。

Setting

"SaveObject/オブジェクトの保存" アクションの引数は次のとおりです。

アクションの引数

説明

Object Type/オブジェクトの種類

The type of object you want to save. Click Table, Query, Form, Report, Macro, Module, Data Access Page, Server View, Diagram, Stored Procedure, or Function in the Object Type box in the Action Arguments section of the Macro Builder pane. To select the active object, leave this argument blank. If you select an object type in this argument, you must select an existing object's name in the Object Name argument.

Object Name/オブジェクト名

保存するオブジェクトの名前。 [ オブジェクト名] ボックスには、データベース内のオブジェクトのうち、 Object Type/オブジェクトの種類 引数で選択した種類のオブジェクトがすべて表示されます。 Object Type 引数を空白のままにした場合は、この引数を空白のままにしてアクティブ オブジェクトを保存するか、場合によっては、この引数に新しい名前を入力して、この名前でアクティブ オブジェクトを保存できます。 新しい名前を入力する場合、名前は Microsoft Access オブジェクトの標準の名前付け規則に従う必要があります。

注釈

The SaveObject action works on all database objects that the user can explicitly open and save. The specified object must be open for the SaveObject action to have any effect on the object. This action has the same effect as selecting an object and then saving it by clicking Save on the Quick Access Toolbar.

Leaving the Object Type argument blank and entering a new name in the Object Name argument has the same effect as clicking Save As on the Quick Access Toolbar, and entering a new name for the active object. Using the SaveObject action enables you to specify an object to save and to perform a Save As command from a macro.

注:

You can't use the SaveObject action to save any of the following with a new name:

  • フォーム ビューまたはデータシート ビューのフォーム
  • 印刷プレビューのレポート
  • モジュール
  • データシート ビューまたは印刷プレビューのサーバー ビュー
  • ページ ビューのデータ アクセス ページ
  • データシート ビューまたは印刷プレビューのテーブル
  • データシート ビューまたは印刷プレビューのクエリ
  • データシート ビューまたは印刷プレビューのストアド プロシージャ

The SaveObject action, whether it's carried out in a macro run in the current database or in a library database, always saves the specified object or the active object in the database in which the object was created.

If you save the active object with a new name, but the name is the same as the name of an existing object of this type, a dialog box asks if you want to overwrite the existing object. If you've set the Warnings On argument of the SetWarnings action to No, the dialog box isn't displayed and the old object is automatically overwritten.

To run the SaveObject action in a Visual Basic for Applications (VBA) module, use the Save method of the DoCmd object.