0 Replies Latest reply on Dec 16, 2013 8:31 PM by creativejoan0425

    Break link to Cell and Table Style and keep the style setting

    creativejoan0425 Level 1

      For cell Selection is work (but can't keep the style setting after break the link), but I also want to break the table style, but error

      For both Break link to cell/table style, I want to keep the style setting after break the link

       

      BreakLinkToTableStyleSelection();
      BreakLinkToCellStyleSelection();

       

      function BreakLinkToTableStyleSelection () {

       

      var
           mNone = app.activeDocument.tableStyles.item(0),
           mSel = app.selection[0];

       

      if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {

       

          mSel.tables.everyItem().appliedTableStyle = mNone;

          return;
          };

       

      if(mSel.hasOwnProperty("baselineShift")){
         
          mSel.tables.everyItem().appliedTableStyle = mNone;

          return;
          };

       

      };

       

       

      function BreakLinkToCellStyleSelection () {

       

      var
           mNone = app.activeDocument.cellStyles.item(0),
           mSel = app.selection[0];

       

      if(mSel.constructor.name === "Cell" || mSel.constructor.name === "Table") {

       

          mSel.cells.everyItem().appliedCellStyle = mNone;

          return;
          };

       

      if(mSel.hasOwnProperty("baselineShift")){
         
          mSel.tables.everyItem().cells.everyItem().appliedCellStyle = mNone;

          return;
          };

       

      };