2 Replies Latest reply on Jun 20, 2010 10:36 PM by Om...

    select multiple header rows

    Om...

      Hi All

       

      I want to select header rows of the table, the header row may be single or multiple.

       

      I tried this app.selection[0].tables[0].rows[0].select(); but this works for single row selection only. Please guide me in the correct way

       

      Thanks in Advance

      Shiv

        • 1. Re: select multiple header rows
          Pat R O'Neill Level 1

          You are only getting one row because you are only referencing the first row, you need to loop through the rows (using the header row count as a counter). See below:

           

          myTable = app.selection[0].tables[0];
          myHeaderCount = myTable.headerRowCount;
          
          for (i=0;i<=myHeaderCount -1;i++)
          {
                  if (i==0) 
                  { 
                              myTable.rows[i].select();
                  }
                  else
                  {
                              myTable.rows[i].select(SelectionOptions.ADD_TO);
                  }
          }
          
          
          • 2. Re: select multiple header rows
            Om... Level 1

            Hi Pat R O'Neil

             

            This is what i needed. Thanks a lot for your effort .

             

            Regards

            Shiv