Share via


Word.FieldKind enum

フィールドの種類を表します。 更新に関連したフィールドの動作を示します。

注釈

[ API セット: WordApi 1.5 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-fields.yaml

// Gets the first field in the document.
await Word.run(async (context) => {
  const field = context.document.body.fields.getFirstOrNullObject();
  field.load(["code", "result", "locked", "type", "data", "kind"]);

  await context.sync();

  if (field.isNullObject) {
    console.log("This document has no fields.");
  } else {
    console.log("Code of first field: " + field.code, "Result of first field: " + JSON.stringify(field.result), "Type of first field: " + field.type, "Is the first field locked? " + field.locked, "Kind of the first field: " + field.kind);
  }
});

フィールド

cold = "Cold"

フィールドに結果がないことを表します。

hot = "Hot"

フィールドが表示されるたびに、またはページが再フォーマットされるたびに自動的に更新されることを表しますが、手動で更新することもできます。

none = "None"

フィールドが無効であることを表します。 たとえば、内部に何もないフィールド文字のペアです。

warm = "Warm"

ソースが変更されたとき、またはフィールドを手動で更新できる場合に、フィールドが自動的に更新されることを表します。