I am making an addin using visual studio powerpoint web app addin template.
Below code Im attempting to set the first 3 words to bold. A breakpoint before this shows that the “words” member is not in the textRange object. I have tried to access .Words in various ways with and without the (). The error message either says “TypeError: shape.textFrame.textRange.Words is not a function” or “Words is undefined”. I have tried upper and lowercase as well. visual studio is 2022
if (shape.textFrame.textRange.text && shape.textFrame.textRange.text.length > 0) {
shape.textFrame.textRange.load("Words");
await context.sync();
let words = shape.textFrame.textRange.Words;
console.log(words);
shape.textFrame.textRange.Words(3).Font.Bold = true;