Thread: [Solved] Check box values to text
View Single Post
 
Old 10-14-2013, 07:01 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

Code:
Private Sub CommandButton1_Click()
Dim oCtr As Control
Dim oRng As Word.Range
  For Each oCtr In Me.Controls
    Select Case TypeName(oCtr)
      Case "CheckBox"
        Select Case oCtr.Name
          Case "CheckBox1"
            If Controls(oCtr.Name).Value = True Then
              Set oRng = ActiveDocument.Bookmarks("bmCB1").Range
              oRng.Text = "CheckBox1 is Checked"
              ActiveDocument.Bookmarks.Add "bmCB1", oRng
            End If
        End Select
      Case "TextBox"
        
      Case "ComboBox"
        
      Case "ListBox"
        
    End Select
  Next oCtr
  Unload Me
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote