Can you increment a date that you are adding as a field to an MSWord document
This seems to be a lot more complicated than it appears.
This link gives instructions on how to do it: http://www.gmayor.com/insert_a_date_other_than_today.htm
And because this is so complicated, here is a Word document with macros for various date functions: http://www.gmayor.com/Zips/DateCalc.zip
Related videos on Youtube
StuperUser
A full stack web app developer most recently using Angular, WebAPI, Dapper. 1.5 years experience in QA and an ISTQB/ISEB Foundation Certificate in Software Testing. BA in Philosophy and Computing from University of Kent. #SOreadytohelp
Updated on September 18, 2022Comments
-
StuperUser over 1 year
I am using MSWord to create a document to plan my week, I want to automatically update a date range automatically before I print it.
e.g. for today's date I'd want to display
18/06/2012 - 29/06/2012
I have inserted a Field with DATE for the first half, but want to automatically calculate the second by inserting e.g.
DATE+11
.How can I do this?
-
StuperUser almost 12 yearsNot so complicated for the single case:
Sub IncrementDateByElevenDays() Selection.InsertDateTime Format((Date + 11), "dd/MM/yyyy") End Sub
-
StuperUser almost 12 yearsUnfortunately, using a macro doesn't automatically update the field when opening the document. Is there a way to do this?