Thread: [Solved] Check box values to text
View Single Post
 
Old 10-14-2013, 10:15 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Is your checkbox named ckLasik and is your bookmark named bmCourse? Put a stop statement in the code and execute it. When you reach the stop, step through using the F8 key and see if you can determine what is not working:

Code:
Dim oCtr As Control
Dim oRng As Word.Range
  For Each oCtr In Me.Controls
    Select Case TypeName(oCtr)
      Stop 'Added stop statement.
      Case "Checkbox"
        Select Case oCtr.Name
          Case "ckLasik"
            If Controls(oCtr.Name).Value = True Then
              Set oRng = ActiveDocument.Bookmarks("bmCourse").Range
              oRng.Text = "CheckBox1 is Checked"
              ActiveDocument.Bookmarks.Add "bmCourse", oRng
            End If
        End Select
        
    End Select
  Next oCtr
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote