I have some keywords already present in my Word document, which I want to be able to search and if found, insert Content Controls on that specific keyword. Something like -
let searchResults = context.document.body.search("[[]*[]]", { matchWildCards: true });
context.load(searchResults, 'text');
let contentControl = searchResults.items[0].text.insertContentControl();
Is there any way to do this? Any help would be appreciated. Thank you.