Skip to main content
Participating Frequently
Jul 29, 2026 10:01 AM UTC
Answered

Unable to add textFrame to a cell by scripting

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

 

    Peter Kahrel
    Peter KahrelCorrect answer
    Community Expert
    Jul 29, 2026 2:01 PM UTC

    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.

    3 replies

    Peter Kahrel
    Community Expert
    Peter KahrelCommunity ExpertCorrect answer
    Community Expert
    Jul 29, 2026 2:01 PM UTC

    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.

    Translate
    Participating Frequently
    Jul 29, 2026 3:44 PM UTC

    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! 

    Translate
    Community Expert
    Jul 29, 2026 10:16 AM UTC

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

    Translate
    -Manan