View Single Post
 
Old 05-26-2019, 02:50 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

It writes ABC and 123 because Greg hard coded that into the template code rather than the strName and strNum from the userform, no doubt while testing if his code worked to populate the controls in the loop (the incrementing date being the important bit of the code), and then forgot to replace the fixed texts with the string variables. It's easily done.

Code:
      .ContentControls(1).Range.Text = "ABC"
      .ContentControls(2).Range.Text = "123"
The date format is set in the date content control properties, but once changed the autotext entry also has to be updated as that contains a copy of the template body with the three content controls.

See attached
Attached Files
File Type: dotm Create Date Cover Sheets.dotm (50.6 KB, 7 views)
__________________
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