javascript - textRange.Words not found? Visual Studio js addin - Stack Overflow

I am making an addin using visual studio powerpoint web app addin template.Below code Im attempting to

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;

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743998637a4541098.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信