Word.CompareTarget enum

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

文書の比較結果の差異を表示する文書を指定します。

注釈

[ API セット: WordApi BETA (プレビューのみ) ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/compare-documents.yaml

// Compares the current document with a specified external document.
await Word.run(async (context) => {
  // Absolute path of an online or local document.
  const filePath = $("#filePath")
    .val()
    .toString();
  // Options that configure the compare operation.
  const options = {
    compareTarget: Word.CompareTarget.compareTargetCurrent,
    detectFormatChanges: false
    // Other options you choose...
    };
  context.document.compare(filePath, options);

  await context.sync();

  console.log("Differences shown in the current document.");
});

フィールド

compareTargetCurrent = "CompareTargetCurrent"

比較結果を現在の文書に配置します。

compareTargetNew = "CompareTargetNew"

比較結果を新規文書に配置します。

compareTargetSelected = "CompareTargetSelected"

比較結果を反映先の文書に配置します。