Leave gray

R

rob p

Thru the help of many of you, I have this following macro. If checkbox is
checked, make the text in that cell and the cell next to it bold. If not
checked, make the font gray. Works nicely.

I finish with a macro that sends the template to the printer, unlocks
template and then locks it again. This clears out all the checkboxs but if
the font was bold because it's checkbox was checked, it stays that way
unchecked after the unlock and lock. What I want to do is uncheck all the
boxes at once and make their adjoining cells gray. (I can't select the whole
doc because there are some fixed cells I need to stay bold.)
thanks.


Sub togglemulticells()
' run macro to unprotect
Let Col = 0
Let Row = 0
Col = Selection.Cells(1).ColumnIndex
Row = Selection.Cells(1).RowIndex
Set myTable = ActiveDocument.Tables(1)
Set myrange = ActiveDocument.Range(myTable.Cell(Row, Col) _
.Range.Start, myTable.Cell(Row, Col + 1).Range.End)
If Selection.FormFields.Item(1).CheckBox.Value = True Then

myrange.Font.Color = wdColorBlack ' works
Selection.Range.Bold = True
Else
myrange.Font.Color = wdColorGray50 ' works
'run macro to protect again...

End If
 
C

Cindy M -WordMVP-

Hi Rob,
Thru the help of many of you, I have this following macro. If checkbox is
checked, make the text in that cell and the cell next to it bold. If not
checked, make the font gray. Works nicely.
I've not seen any of the discussion up until now, but my advice would be to
create two CHARACTER styles for formatting just these table cells. Apply the
appropriate style, rather than changing the formatting directly. When you want
to change everything, you could use Find/Replace to find the "bold" style and
replace it with the "gray" style. This way, you don't touch anything but these
cells.
I finish with a macro that sends the template to the printer, unlocks
template and then locks it again. This clears out all the checkboxs but if
the font was bold because it's checkbox was checked, it stays that way
unchecked after the unlock and lock. What I want to do is uncheck all the
boxes at once and make their adjoining cells gray. (I can't select the whole
doc because there are some fixed cells I need to stay bold.)
thanks.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top