question

46876118 avatar image
0 Votes"
46876118 asked ·

Office.js How to select 2 ContentControls

 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-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLaude avatar image
0 Votes"
LeonLaude answered ·

Hi,

Office development is currently not supported in the Q&A forums, the supported products are listed over here https://docs.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

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.