Word.GetTextOptions interface
Specifies the options to be included in a getText operation.
Remarks
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
include |
Specifies a value that indicates whether to include hidden text in the result of the GetText method. The default value is False. |
include |
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
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
Office Add-ins