title: Inserting Editable content control in Word online add-in
body: <p>In my Word Add-In, I want my user to be able to insert a template, with editable content controls. Works fine in Word client, but in Word online, I can't get it to work properly.</p>
  
  <p>You'll find my code below. I get a debug error saying <code>The action isn't supported in Word Online. Error location : ContentControl.placeholderText</code>.
  Indeed when I comment out the line setting placeholderText, I get no error. But then my add-in only adds lines of empty text, which is not my purpose obviously.</p>
  
  <pre><code>Word.run(function (context) {
          var thisDocument = context.document,
              range = thisDocument.getSelection();
  
              case "ProtagonistsIntroduction":
                  var paragraph = range.insertParagraph("Customer", Word.InsertLocation.before);
                  paragraph.styleBuiltIn = "Heading1";
                  setTemplateContentControlProperties(range, "Mr/Ms. and name", true);
                  //I insert here many other content controls
                  break;
      })
      .catch(function (error) {
          console.log('Error: ' + JSON.stringify(error));
          if (error instanceof OfficeExtension.Error) {
              console.log('Debug info: ' + JSON.stringify(error.debugInfo));
          }
      });
  function setTemplateContentControlProperties(container, placeholderText, lineBreakAfter) {
          var contentControl = container.insertContentControl();
          contentControl.appearance = "BoundingBox";
          contentControl.removeWhenEdited = true;
          contentControl.placeholderText = placeholderText;
          if (lineBreakAfter) {
              contentControl.insertBreak("Line", Word.InsertLocation.after);
          }
          return contentControl;
      }
  </code></pre>
  
  <p>As this tool is here to provide the user with a document template with all the information that he should include, I need these placeholders.
  Is there a way around this ?</p>
  
  <p>I would be OK with a way of just adding lines of text instead of content controls when in Word Online ; but adding the content controls when I'm in a compatible environment (Word client) ; if there isn't anything better than that.</p>
  
  <p>Cheers !</p>