Skip to main content
Participant
June 18, 2010
Question

select multiple header rows

  • June 18, 2010
  • 1 reply
  • 1808 views

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

This topic has been closed for replies.

1 reply

Known Participant
June 18, 2010

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.select();
        }
        else
        {
                    myTable.rows.select(SelectionOptions.ADD_TO);
        }
}
Om___Author
Participant
June 21, 2010

Hi Pat R O'Neil

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

Regards

Shiv