I am trying to get all content controls present in the document. As per microsoft Word API docuemntation only RichText and plain Text type content controls are supported. But i am not able to get the plain text type content controls. I get only richtext content controls.
const contentControls = doc.contentControls;
contentControls.load('title, tag, type');
return context.sync().then(function () {
// Loop through the content controls
console.log(contentControls.items.length);
for (let i = 0; i < contentControls.items.length; i++) {
const contentControl = contentControls.items[i];
console.log(`Content Control #${i + 1}`);
console.log('Title: ', contentControl.title);
console.log('Tag: ', contentControl.tag);
console.log('Type: ', contentControl.type);
}
});
I tried using below WordAPI refrence: https://appsforoffice.microsoft.com/lib/beta/hosted/office.js OR https://appsforoffice.microsoft.com/lib/1/hosted/office.js With both refrences the result contains only richtext content controls.
Am i missing something or plain text type content controls are still not supported via word API?
Plain text content controls are currently supported in Word JavaScript API requirement set 1.5. Please use Document.getContentControls(options) API. Leaving the options
parameter empty will get both rich text and plain text content controls in the document. If you want plain text only, please specify the option "PlainText".