![]() |
|
|
|
#1
|
|||
|
|||
|
In every Word document VB Project "ThisDocument" module there is an event:
Here, I have applied the tag "ManNum" to CCs requiring and numerical input and "ManText" to those requiring a text input. Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Select Case ContentControl.Tag
Case "ManText"
If ContentControl.ShowingPlaceholderText Then
MsgBox "This field requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
Case "ManNum"
If Not IsNumeric(ContentControl.Range.Text) Then
MsgBox "This field requires a numeric response.", vbInformation + vbOKOnly, "INPUT REQUIRED"
Cancel = True
End If
End Select
lbl_Exit:
Exit Sub
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
how to make a template with field and mailmerge to work together in protected mode
|
pjkon | Mail Merge | 1 | 06-10-2019 04:35 PM |
| How To Make 2013 Populate To Field | abraxis | Outlook | 2 | 08-10-2018 06:41 AM |
How to make a Check Box Form Field red if not checked?
|
CarlCR | Word Tables | 3 | 07-12-2016 08:35 PM |
How to make a SEQ field show up in cross references?
|
Roscoe | Word | 5 | 06-01-2016 01:39 PM |
| make text form field active dependent on dropdown | Glenn0004 | Word VBA | 1 | 06-23-2015 06:13 PM |