![]() |
#4
|
||||
|
||||
![]()
Try the following streamlined version of your on-exit macro:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) With ContentControl Select Case .Title Case "HomePhone", "CellPhone", "WorkPhone", "OtherRefererPhone", "GuardianPhone", "EmergencyContactPhone", "PhysicianPhone" .Range.Text = Format(.Range.Text, "(###) ###-####") Case "PHN" .Range.Text = Format(.Range.Text, "#####-####") Case "ApptTimeTop" .Range.Text = Format(.Range.Text, "@ #########") Case "DateOfBirth" ContentControl.Range.Tables(1).Cell(6, 1).Range.Paragraphs.Last.Range.Text = DateDiff("yyyy", CDate(.Range.Text), Now) End Select End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
age;content control |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Sammie0Sue | Word VBA | 21 | 01-12-2021 04:44 PM |
Content Controls in Headers | ejungk99 | Word | 2 | 06-16-2014 04:02 PM |
![]() |
Something Anon | Word | 4 | 03-26-2014 03:53 PM |
![]() |
Sammie0Sue | Word | 6 | 11-06-2013 10:56 PM |
![]() |
cksm4 | Word VBA | 2 | 03-01-2011 12:46 PM |