Office.js How to select 2 ContentControls

Швецов Пётр 1 Reputation point
2020-06-18T17:13:32.41+00:00
function selectTwo(){ 
   return Word.run(function(context) {  
      var contentControls = context.document.contentControls;
      context.load(contentControls, "items");
      return context.sync().then(() => {
         contentControls.items[0].select(); 
         contentControls.items[1].select();
         return context.sync();
      });
  });
}

When I select the second Content Control I loose selection of the first. I just want to select both the first and the second.

There is some selectionMode enum ("Select" | "Start" | "End"). But the documentation says nothing of meaning of this enum options

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,646 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 85,716 Reputation points
    2020-06-18T17:23:06.53+00:00

    Hi,

    Office development is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated Office development forum over here:
    https://social.msdn.microsoft.com/forums/office/en-us/home?category=officedev

    (Please don't forget to accept helpful replies as answer)

    Best regards,
    Leon

    0 comments No comments