Skip to main content
Participating Frequently
July 29, 2026
Question

Unable to add textFrame to a cell by scripting

  • July 29, 2026
  • 3 replies
  • 15 views

Using extendscript I want to insert a textFrame at the end of a table cell that contains several paragraphs. But this keeps throwing an error stating that this is not allowed for graphic type cells. But the cell is not a graphic type, as I already placed several paragraphs in it. And even after forcing the cell type to text the error remains:

        cell.cellType = CellTypeEnum.TEXT_TYPE_CELL;

        newFrame = cell.textFrames.add();

Throws a runtime error as indicated.

Is this a bug ?

Running version 21.4.1.164

 

    3 replies

    Peter Kahrel
    Community Expert
    Community Expert
    July 29, 2026

    What you should do is add a frame at an insertion point: 

    newFrame = cell.insertionPoints[-1].textFrames.add();

    That error about graphic frame content is a red herring.

    Participating Frequently
    July 29, 2026

    Thanks Kahrel,

    At least that gets rid of the error being thrown; the frame is actually created at the insertion point with initial size. Thanks! 

    Community Expert
    July 29, 2026

    Hi ​@RoelofJanssen2, Does it happen with just a particular document/table or did you try it on others as well

    -Manan