Application.SetField メソッド (Project)

選択したタスクやリソースのローカル ユーザー設定フィールドまたはエンタープライズ ユーザー設定フィールドの値を設定します。

構文

expressionSetField( _Field_, _Value_, _Create_ )

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

パラメーター

名前 必須 / オプション データ型 説明
Field 必須 String 設定するフィールドの名前を指定します。
Value 必須 String フィールドの名前
Create 省略可能 Boolean 新しい値が作成された場合は true。それ以外の場合は False。 既定値は True です。

戻り値

ブール型 (Boolean)

注釈

ユーザー設定フィールドが、追加のアイテムを登録できない参照テーブルを使用する場合、指定した Value は参照テーブル内の定義済みの値と一致する必要があります。

選択したアイテムのカスタム フィールド名として Field 引数の値が存在しない場合、 SetField メソッドを実行すると、実行時エラー 1101 が発生します。

The following example sets the value of an enterprise task text custom field to one of the valid values in the lookup table for the custom field. To use the example, create a lookup table in Project Web App that includes the value Value 3, and then create a task custom text field that uses that lookup table. Select a task in the active project and run the command in the Immediate window in the Visual Basic Editor.

Application.SetField Field:="TestEntTaskText", Value:="Value 3"

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

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