View Single Post
 
Old 04-08-2020, 07:03 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Andrew, good point. This might do better if picking a date other than today.


Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean)
  If CC.Type = wdContentControlDate Then
    If IsDate(CC.Range.Text) Then
      If CC.DateDisplayFormat = "M/d/yyyy h:mm:ss am/pm" Then
         CC.Range.Text = Format(CDate(CC.Range.Text), "M/d/yyyy") & " " & Time
      End If
    End If
  End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote