![]() |
#5
|
|||
|
|||
![]()
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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add custom doc properties in "Doc properties control" | eazysnatch | Word | 2 | 09-13-2017 08:08 PM |
![]() |
David C | Word | 1 | 10-24-2012 04:53 AM |
![]() |
Panzer | Word VBA | 2 | 08-22-2012 04:17 AM |
Excel VBA: Control Word Table and Set its properties | tinfanide | Excel Programming | 0 | 12-10-2011 09:06 AM |
Printable Entry Form | eJames | Excel | 1 | 01-07-2010 09:50 AM |