Thread: [Solved] Option Button help
View Single Post
 
Old 01-15-2015, 01:36 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,600
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

If you are using a content control (e.g., one titled "TextCC") then you don't need a bookmark for this:

Code:
Option Explicit
Private strVal As String
Private Sub OptionButton1_Click()
  If Me.OptionButton1.Value = True Then
    ActiveDocument.SelectContentControlsByTitle("TextCC").Item(1).Range.Text = strVal
  End If
End Sub
 
Private Sub OptionButton2_Click()
  If Me.OptionButton2.Value = True Then
    strVal = ActiveDocument.SelectContentControlsByTitle("TextCC").Item(1).Range.Text
    ActiveDocument.SelectContentControlsByTitle("TextCC").Item(1).Range.Text = vbNullString
  End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote