How do I display the next month in a Microsoft Word field?

*爱你&永不变心* 提交于 2020-01-03 03:37:05

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/3775872/how-do-i-display-the-next-month-in-a-microsoft-word-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!