ONLYOFFICE/DocumentBuilder

ContentControl delete invalid

verydemo opened this issue · 1 comments

  • builder version
    image

  • my code
    image

builder.OpenFile("test1.docx");
oDocument = Api.GetDocument();
oContentControls = oDocument.GetAllContentControls();
for (var i = oContentControls.length-1; i >= 0;i--)
{
    oContentControls[i].Delete(false);
}

oContentControls1 = oDocument.GetAllContentControls();
console.log("oContentControls1[0].GetClassType()");
console.log(oContentControls1[0].GetClassType());
console.log("oContentControls1.length")
console.log(oContentControls1.length)

builder.SaveFile("docx", "test2nocc.docx");
builder.CloseFile();
  • i want to delete ContentControl. it run no problem, but it is invalid.

  • print message

    oContentControls1[0].GetClassType()
    blockLvlSdt
    oContentControls1.length
    249

image

Hi, could you attach original tests1.docx you want to edit?