Page 1 of 1

InsertAndReplaceContentControls inline

Posted: Mon Jan 07, 2019 9:56 pm
by Serhii
Hi!

How to replace the existing inline "Content Control" with simple inline text?

The example code from the documentation

Code: Select all

window.Asc.plugin.executeMethod('InsertAndReplaceContentControls', [[{
          Props: {
            InternalId: currentCCInternalId
          },
          Script: "var doc = Api.GetDocument(); var p = Api.CreateParagraph(); p.AddText('Hello world!'); doc.InsertContent([p]);"
        }]])
adds unnecessary line break after "Hello world!", but I need to replace without it.

Re: InsertAndReplaceContentControls inline

Posted: Tue Feb 05, 2019 7:57 am
by Carl
Hello,
Try to insert it like this

Code: Select all

oDocument.InsertContent([p], true);