Word.GetTextOptions interface

Specifies the options to be included in a getText operation.

Remarks

[ API set: WordApi 1.7 ]

Examples

// 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);
});

Properties

includeHiddenText

Specifies a value that indicates whether to include hidden text in the result of the GetText method. The default value is False.

includeTextMarkedAsDeleted

Specifies a value that indicates whether to include text marked as deleted in the result of the GetText method. The default value is False.

Property Details

includeHiddenText

Specifies a value that indicates whether to include hidden text in the result of the GetText method. The default value is False.

includeHiddenText?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.7 ]

includeTextMarkedAsDeleted

Specifies a value that indicates whether to include text marked as deleted in the result of the GetText method. The default value is False.

includeTextMarkedAsDeleted?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.7 ]