View Single Post
 
Old 06-26-2014, 05:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote