J
JuanManuel
I’m working on a small project to incorporate some vba functionality to a
template in Microsoft Word. It is a fairly long template (over 30 pages) with
extensive use of tables. We would like to be able to collapse and expand rows
as needed, so that the printed document only shows what is really relevant.
I have found VBA code that seems to be useful in achieving this.
Nevertheless, I'm having trouble trying to figure out how to implement
another requirement, and don’t know whether it’s even feasible:
1. Once the user has selected one out of four radio buttons, the Word
document should automatically switch its current font color to a specific
color (corresponding to the appropriate alternative), so that the text that
the user inputs thereafter is of that color. We want to avoid the user having
to change font colors manually upon selecting one of the initial 4
alternatives. Although I found code to change the font color from the
“formatting toolbarâ€, I was quickly discouraged when testing the code.
The problem is that as soon as the user positions the cursor in the cell
where he wants to type, the font color switches back to automatic (it doesn’t
show a font color change at the “formatting toolâ€, but if you click on it,
you see that the automatic color has been selected). As it is, the code would
serve its purpose if the document didn’t use tables and you moved from line
to line by using enter. Only in this case does the font color change holds.
Any suggestion as to how could I accomplish this task is greatly appreciated?
template in Microsoft Word. It is a fairly long template (over 30 pages) with
extensive use of tables. We would like to be able to collapse and expand rows
as needed, so that the printed document only shows what is really relevant.
I have found VBA code that seems to be useful in achieving this.
Nevertheless, I'm having trouble trying to figure out how to implement
another requirement, and don’t know whether it’s even feasible:
1. Once the user has selected one out of four radio buttons, the Word
document should automatically switch its current font color to a specific
color (corresponding to the appropriate alternative), so that the text that
the user inputs thereafter is of that color. We want to avoid the user having
to change font colors manually upon selecting one of the initial 4
alternatives. Although I found code to change the font color from the
“formatting toolbarâ€, I was quickly discouraged when testing the code.
The problem is that as soon as the user positions the cursor in the cell
where he wants to type, the font color switches back to automatic (it doesn’t
show a font color change at the “formatting toolâ€, but if you click on it,
you see that the automatic color has been selected). As it is, the code would
serve its purpose if the document didn’t use tables and you moved from line
to line by using enter. Only in this case does the font color change holds.
Any suggestion as to how could I accomplish this task is greatly appreciated?