Skip to main content
Participant
Jun 18, 2010 9:04 AM UTC
Question

select multiple header rows

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

Known Participant
Jun 18, 2010 3:44 PM UTC

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);
        }
}
Translate
Om___Author
Participant
Jun 21, 2010 5:36 AM UTC

Hi Pat R O'Neil

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

Regards

Shiv

Translate