jpabz
02-11-2016, 11:26 AM
Hello
is there a way to lock the content control that is linked to a combobox on a userform? Currently, users are able to go in the document and edit the controls. I can lock the control using content controls property, but the userform combobox linked to textbox that is then pasted to the document will not work due to being locked.
Code example
Private Sub Combobox3_Change()
If ComboBox3.Value = "Applied Research" Then
TextBox8.Value = "Dr. Bob"
TextBox20.Value = "Dr. James"
ElseIf ComboBox3.Value = "Corporate" Then
TextBox8.Value = "Dr. Jay"
TextBox20.Value = "Dr. Gray"
End If
End Sub
Private Sub CommandButton1_Click()
With ActiveDocument
.SelectContentControlsByTitle("Dr. Name").Item(1).Range.Text = Me.TextBox20
.SelectContentControlsByTitle("Alternate Doctor").Item(1).Range.Text = Me.ComboBox8
End Sub
is there a way to lock the content control that is linked to a combobox on a userform? Currently, users are able to go in the document and edit the controls. I can lock the control using content controls property, but the userform combobox linked to textbox that is then pasted to the document will not work due to being locked.
Code example
Private Sub Combobox3_Change()
If ComboBox3.Value = "Applied Research" Then
TextBox8.Value = "Dr. Bob"
TextBox20.Value = "Dr. James"
ElseIf ComboBox3.Value = "Corporate" Then
TextBox8.Value = "Dr. Jay"
TextBox20.Value = "Dr. Gray"
End If
End Sub
Private Sub CommandButton1_Click()
With ActiveDocument
.SelectContentControlsByTitle("Dr. Name").Item(1).Range.Text = Me.TextBox20
.SelectContentControlsByTitle("Alternate Doctor").Item(1).Range.Text = Me.ComboBox8
End Sub