Thread: [Solved] Set variable word field
View Single Post
 
Old 09-03-2020, 02:28 AM
eduzs eduzs is offline Windows 10 Office 2019
Expert
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default Set variable word field

This field code returns a date:

{ QUOTE { SET Delay -1 } { SET m { =MOD({ DATE \@ MM }+Delay+11;12)+1 } }{ SET y { =INT({ DATE \@ yyyy }+(Delay+{ DATE \@ M }-1)/12) } } “{ m }-{ y }” \@ “MMM/yy” }

But, instead of "QUOTE" show the date, I need to set a variable with this date.
How to set a variable instead of show the date?

Something like (which does not works):

{ SET DateX { QUOTE { SET Delay -1 } { SET m { =MOD({ DATE \@ MM }+Delay+11;12)+1 } }{ SET y { =INT({ DATE \@ yyyy }+(Delay+{ DATE \@ M }-1)/12) } } “{ m }-{ y }” \@ “MMM/yy” } }

So, if elsewhere in the document I want to see the date, I just insert a field:

{ DateX }

Ps.: please move this topic to WORD , sorry.

Thanks
__________________
Backup your original file before doing any modification.
Reply With Quote