Word.GetTextOptions interface

指定要包含在 getText 操作中的选项。

注解

[ API 集:WordApi 1.7 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/get-text.yaml

await Word.run(async (context) => {
  const paragraph: Word.Paragraph = context.document.getSelection().paragraphs.getFirst();

  const text = paragraph.getText();
  const textIncludingHidden = paragraph.getText({ IncludeHiddenText: true });
  const textIncludingDeleted = paragraph.getText({ IncludeTextMarkedAsDeleted: true });

  await context.sync();

  console.log("Text:- " + text.value, "Including hidden text:- " + textIncludingHidden.value, "Including text marked as deleted:- " + textIncludingDeleted.value);
});

属性

includeHiddenText

指定一个值,该值指示是否在 GetText 方法的结果中包含隐藏文本。 默认值为 False。

includeTextMarkedAsDeleted

指定一个值,该值指示是否在 GetText 方法的结果中包含标记为已删除的文本。 默认值为 False。

属性详细信息

includeHiddenText

指定一个值,该值指示是否在 GetText 方法的结果中包含隐藏文本。 默认值为 False。

includeHiddenText?: boolean;

属性值

boolean

注解

[ API 集:WordApi 1.7 ]

includeTextMarkedAsDeleted

指定一个值,该值指示是否在 GetText 方法的结果中包含标记为已删除的文本。 默认值为 False。

includeTextMarkedAsDeleted?: boolean;

属性值

boolean

注解

[ API 集:WordApi 1.7 ]