Can you increment a date that you are adding as a field to an MSWord document

6,426

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

Share:
6,426

Related videos on Youtube

StuperUser
Author by

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, 2022

Comments

  • StuperUser
    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
    StuperUser almost 12 years
    Not so complicated for the single case: Sub IncrementDateByElevenDays() Selection.InsertDateTime Format((Date + 11), "dd/MM/yyyy") End Sub
  • StuperUser
    StuperUser almost 12 years
    Unfortunately, using a macro doesn't automatically update the field when opening the document. Is there a way to do this?