2

I'm needing to display the name of the month after the current month in a Word 2003 document.

It's fairly easy to display the current month:

{ DATE \@ "MMMM" }

At the time of this writing, this displays: September

What I'm wanting to display is October...and for the life of me I cannot work out what needs to be done.

I've been trying to follow the advice on addbalance but without much luck:

{ = { Date \@ "MMMM" } + 1 }

Does anyone know what command I need to write to be able to accomplish this seemingly simple task?

mezoid
  • 28,090
  • 37
  • 107
  • 148

2 Answers2

3

You can use a QUOTE field to do so. The documentation contains an example to show the previous month, which could be easily modified to show the next month:

{ QUOTE "1.{ IF { DATE \@ "M" }=12 "1" "{ = { DATE \@ "M" }+1} }.2010" \@ "MMMM"}

Note that you probably need to change the format of the date generated by the IF field to match your current locale settings. The part { IF { DATE \@ "M" }=12 "1" "{ = { DATE \@ "M" }+1} } is used to get the next month and should be used to generate a complete (imaginary) date, e.g. 1.<nextmonth>.2010 or <nextmonth>/01/05.

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • Awesome! That worked, though I had to change it to { QUOTE { IF { DATE \@ "M" } = 12 "1" "1/{= { DATE \@ "M" } + 1 }/03" \@ "MMMM"}} in order to have it work in Australia – mezoid Sep 23 '10 at 23:34
  • @mezoid: I noticed there was a bug in the sample provided by Microsoft. It doesn't work for December/January. See my update for a fix. – Dirk Vollmar Sep 24 '10 at 08:14
  • I tested it out, and you were right, it does have a bug in it...and I've tested your updated solution and it works great. Thanks so much for that! I wish I could give you 100 points! – mezoid Sep 27 '10 at 02:35
0

ah yes but what if you want to calculate a calendar month ahead which spans a new year, e.g. it goes from Dec 2020 to Jan 2021 automatically? This formula doesn't handle that due to a static year and couldn't handle a new year either with a static one.

  • Note this is more of a *comment* rather than an *answer*. At 50 reputation, you can leave comments. Read more here: https://stackoverflow.com/help/privileges/comment – costaparas Dec 21 '20 at 06:48