最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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;
发布评论

评论列表(0)

  1. 暂无评论