Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

check boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fuzzhead - 21 Jan 2007 02:30 GMT
I have the following macro that will update a check box. My document has 25
check boxes. Is there a way to write one macro that will update all the boxes
instead of coping the following 25 times?

If frm.cb1.Value = True Then
ActiveDocument.FormFields("Check25").CheckBox.Value = 1
Else
ActiveDocument.FormFields("Check25").CheckBox.Value = 0
End If
Greg Maxey - 21 Jan 2007 03:18 GMT
Try

Dim i As Long

If frm.cb1.Value = True Then
 For i = 1 to 25
   ActiveDocument.FormFields("Check" & i).CheckBox.Value = 1
 Next i
Else
 For i = 1 to 25
   ActiveDocument.FormFields("Check" & i).CheckBox.Value = 0
Next i
End If

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I have the following macro that will update a check box. My document
> has 25 check boxes. Is there a way to write one macro that will
[quoted text clipped - 5 lines]
> ActiveDocument.FormFields("Check25").CheckBox.Value = 0
> End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.