InsertAndReplaceContentControls inline

Integration questions/issues
Post Reply
Serhii
Posts: 6
Joined: Mon Dec 24, 2018 10:56 pm

InsertAndReplaceContentControls inline

Post by Serhii » Mon Jan 07, 2019 9:56 pm

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.

Carl
Posts: 160
Joined: Thu Apr 12, 2018 10:00 am

Re: InsertAndReplaceContentControls inline

Post by Carl » Tue Feb 05, 2019 7:57 am

Hello,
Try to insert it like this

Code: Select all

oDocument.InsertContent([p], true);

Post Reply