hmmm....this may be a bit over my head I think. The one content control I need to have validated is a simple yes/no selection control that I need the user to answer, otherwise they will not be able to continue to tab to the next entry. So to validate the content control, which I named "ok to call Y-N" control should be the named control in the script, just not sure how to set it in the vb editor for the document. Any examples?? or can I get some help with a snipet? maybe email the document? Sorry to be a pain.
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, _
Cancel As Boolean)
Dim strTemp As String
Dim bGate1 As Boolean, bGate2 As Boolean, bGate3 As Boolean
Dim bGate4 As Boolean, bGate5 As Boolean, bValid As Boolean
Dim i As Long
Dim oRng As Word.Range
strTemp = CC.Range.Text
bValid = False
'If Application.Version < "14.0" Then Main.SetDeveloperTabActive
Select Case CC.Title
Case "ok to call Y-N"
If CC.ShowingPlaceholderText = True Or strTemp = "" Then
MsgBox "This field cannot be left blank."
'Makes CC mandatory. User can' exit until data is entered.
Cancel = True
End If
End Select
lbl_Exit:
Exit Sub
End Sub
still was able to tab through CC
|