1

Article: https://dev.office.com/reference/add-ins/word/word-add-ins-reference-overview

Issue: Firstly, I added multiple ContentControls manually in Document. Then, I want to list all ContentControls. But, search no result.

Visual Studio 2017 Office 2016

Step1: F5 to Run in VS.

Step2: In Word, Select 'Develop' menu -> 'Insert a plain text content control'

Step3: In right task panel, click search button.

    var docControls = context.document.contentControls;


    docControls.load(["items"]); 

    return context.sync()
        .then(function () {

            console.log(docControls);

        })
        .catch(function (e) {
            console.log(e);
        })

steps gif

Code image

1
  • Welcome to Stack Overflow! Since you are new user, I recommend you read "How to Ask a Good Question". For future reference, screen shots are great but screen shots of code are extremely hard to work with. You should include the code directly in your question so others can quickly copy/paste your code to replicate your problem. Commented Oct 30, 2017 at 2:54

2 Answers 2

2

The only type of content control supported in Office.js is the rich text content control. All the other ones are not yet supported, they are in our backlog but do not have a specific ETA.

Sign up to request clarification or add additional context in comments.

1 Comment

Saved my weekend. I spent hours to find out the root cause and it was so difficult to get here. The documentation does not mention this at all.
0

EDIT: I can reproduce that Plain Text content controls are not seen. I will follow up with the engineers.

1 Comment

Thank you. I answered by follows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.