1 Reply Latest reply on Dec 6, 2010 5:39 AM by Harbs.

    Insert table before table...

    MrLeif Level 1

      I need to insert a small table before an existing one.



      //"myTable" is a reference to existing table

      //checked with select() - InDesign knows it's there


      myTableTF = myTable.parent; //Textframe that is myTable's parent


      //now this should create a table??


      preTable = myTableTF.tables.add(LocationOptions.BEFORE, myTable, {columnCount:2, bodyRowCount:1});


      --- and all I get is this error;


      "cannot create preTable Error: Invalid value for parameter 'reference' of method 'add'. Expected Table, XMLElement, XmlStory, TextFrame, Text, InsertionPoint, TextStyleRange, Paragraph, TextColumn, Line, Word, Character, Story or Cell, but received Table."


      What is the correct way to insert a table before an existing one??