await Word.run(async (context) => {
const document = context.document;
const body = document.body;
const paragraphs = body.paragraphs;
paragraphs.load({ $all: true });
let listItems = [];
let paragraphText = {};
await context.sync();
for (let i = 0; i < paragraphs.items.length; i++) {
paragraphGUIDHash.set(paragraphs.items[i].uniqueLocalId, true);
listItems.push(paragraphs.items[i].listItemOrNullObject);
listItems[i].load("listString");
}
try {
await context.sync();
} catch (error) {
console.log("Loading error for list paragraph api!!!");
}
for (let i = 0; i < paragraphs.items.length; i++) {
paragraphText[i] = paragraphs.items[i].getText({ IncludeHiddenText: false, IncludeTextMarkedAsDeleted: false});
}
let sectionsJson = [];
let currentSection = [];
let sectionCount = 1;
try {
await context.sync();
} catch (error) {
console.log("Loading error for paragraph text!!!");
}
})
The issue over here when i use getText() i run into Richapi error and i found it on word addin PC version of windows with Office 365 version 2308 (Build 16731.20948) on our client side. But the issue seems to be not there when we use getReviewedText().
Same issue we are not over observing on our side windows with Office 365 version 2501 (Build 18429.20132). Now Can any let me know what's the issue here because on last context.sync() getting RichApi.Error: GeneralException error.
Is there any way this can be fixed with latest version of Office JS or should have fall back mechanism everytime to switch between getText() and getReviewedText().