crowfan
08-28-2007, 12:29 PM
Hello,
I am trying to write a macro that will apply two specific styles to a table. The first row should be set to style "TableHeading" and the rest of the rows should be set to "TableText." There are a *ton* of different styles that appear in these tables originally, and the goal is to convert them all to TableText (and TableHeading, where appropriate).
So far I have written a macro that selects the table, applies the "TableText" style to the whole table, and then applies the "TableHeading" style to the first row.
The problem is that there is one style that won't allow itself to be changed. I have tried the following:
- changing the style of the table (table.range.style) to TableText
- selecting the table (table.select) and changing the selection's style to TableText (selection.style="tabletext")
- looping through the table and changing each row's style to TableText (count the # of rows, then doing a loop from 1=2 to count, rows(i).range.style=Tabletext)
- selecting each row and changing the style of the row itself (row(i).range.style=tabletext)
Each one of them works beautifully (i.e., the styles change as they should), except for this one specific style. That one stays the same, no matter how I attack it. The "problem style" is applied only to a few characters within the cell, not the whole row/cell.
If I select the row manually and apply the style, the prolem-style changes as it should. But not when I do it within a macro.
Any ideas? Thanks!
I am trying to write a macro that will apply two specific styles to a table. The first row should be set to style "TableHeading" and the rest of the rows should be set to "TableText." There are a *ton* of different styles that appear in these tables originally, and the goal is to convert them all to TableText (and TableHeading, where appropriate).
So far I have written a macro that selects the table, applies the "TableText" style to the whole table, and then applies the "TableHeading" style to the first row.
The problem is that there is one style that won't allow itself to be changed. I have tried the following:
- changing the style of the table (table.range.style) to TableText
- selecting the table (table.select) and changing the selection's style to TableText (selection.style="tabletext")
- looping through the table and changing each row's style to TableText (count the # of rows, then doing a loop from 1=2 to count, rows(i).range.style=Tabletext)
- selecting each row and changing the style of the row itself (row(i).range.style=tabletext)
Each one of them works beautifully (i.e., the styles change as they should), except for this one specific style. That one stays the same, no matter how I attack it. The "problem style" is applied only to a few characters within the cell, not the whole row/cell.
If I select the row manually and apply the style, the prolem-style changes as it should. But not when I do it within a macro.
Any ideas? Thanks!