View Single Post
 
Old 06-08-2016, 06:04 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

OK. Add the following to the ThisDocument module of the document

Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    If ContentControl.Title = "Issue Date" Then
        If Not ContentControl.Range.Text = ContentControl.PlaceholderText Then
            ActiveDocument.SelectContentControlsByTitle("Expiry Date").Item(1).Range.Text = _
            DateAdd("m", 12, CDate(ContentControl.Range.Text))
        End If
    End If
End Sub
Save the document as a macro enabled template and create new documents from it. As you tab out of the first date field the second one reflects 12 added months.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote