Need to update a Macro

S

SCook

If anyone can assist me with the following problem I would greatly
appreciate it!

I am using a Word Template which contains various tables. One column in
one of the tables contains a check box, which is associated with a
Marco. The function of this Macro is to highlight the row when the
check box is checked. Here is the Macro that I am currently using:


Sub REDhighlightwhenchecked()
'
' REDhighlightwhenchecked Macro
' Macro created 9/14/2006 by Shannon Cook
'
Dim ffname As String
ffname = Selection.FormFields(1).Name
With ActiveDocument
.Unprotect
If .FormFields(ffname).CheckBox.Value = True Then
.Bookmarks(ffname).Range.Rows(1).Shading.BackgroundPatternColor
_
= wdColorRed
Else
.Bookmarks(ffname).Range.Rows(1).Shading.BackgroundPatternColor
_
= wdColorAutomatic
End If
.Protect wdAllowOnlyFormFields, NoReset
End With


End Sub


Here is the current situation: I am in the process of altering the
format of the template. Instead of having only one check box in the
row, I will now have 6 check boxes in a single row. Each check box is
associated with a different color. What I have found is that I need to
alter the existing macro to have the check boxes be mutually exclusive,
i.e. Each row can only have one check box checked at a time.


Help!
SCook
 
C

Cindy M.

Hi =?Utf-8?B?U0Nvb2s=?=,
Here is the current situation: I am in the process of altering the
format of the template. Instead of having only one check box in the
row, I will now have 6 check boxes in a single row. Each check box is
associated with a different color. What I have found is that I need to
alter the existing macro to have the check boxes be mutually exclusive,
i.e. Each row can only have one check box checked at a time.
You'll find an article on this on the word.mvps.org website. Basically,
the macro needs to run through all the form fields within a given range
(the Row.Range in this case), make sure it's dealing with a checkbox, then
set the value of the checkbox.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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