4 Replies Latest reply on Feb 22, 2011 9:00 AM by Harbs.

    [CS5] parentPage  - object does not support the property or method 'parentPage'?

    MrLeif Level 1

      I'm working on a project where I among other things resize tables and table cells.


      Suddenly this line of code throws an "object does not support the property or method 'parentPage'";


      var zPage = myTable.parent.parentPage;


      Before this line, all tables have been labeled, and given a style using appliedTableStyle


      Both these properties is logged just fine in the two lines prior to the line that throws the error.


      workaround: using myTable.parent.parent.documentOffset;

      What can cause this?


      To make this even more "interesting" (logThis is a function where I write a timestamp and the logtext to the.. logfile);

      textFrames altso throws an error;



                  logThis("\t\t ADDING TF in page: # " +myPageOffset);  #works, returns  ADDING TF in page: # 0
                  logThis(myDocument.pages);#works, returns [object Pages]
                  logThis(myDocument.pages.item(myPageOffset)); # works, returns [object Page]
                  logThis(myDocument.pages.item(myPageOffset).textFrames); #error: returns "object is invalid"



      This worked yesterday...