#1
|
|||
|
|||
Document properties in word - date format
Dear all Master here
Let me introduce my self, my name is cipta, I from indonesia. I have problem with automatic update for date format such like field code : Docproperty "date completed"\@ "dd-MMM-yy"\* mergeformat become 24-oct-13[suppose: today]. So my problem is how create field code, if today+1 become 25-oct-13. Great appreciate, if you can help me Regards Cipta |
#2
|
|||
|
|||
See Calculated Dates in Microsoft Word using Fields or vba
Because of the ideosyncracies of the calendar, this is not simple. For the 24th to the 25th is simple. But because months can have different numbers of days and adding 1 to December 31 can push you into a different year, you don't end up just changing the day field. A field for this looks something like { QUOTE "{ SET " Delay" "1" } { SET "DaysInMonth" { IF { CreateDate \@ "MM" } <> 2 { = ROUND(30.575*{ CreateDate \@ "MM" },0)- ROUND(30.575*{ = { CreateDate \@ "MM" } -1 },0) } { IF { = MOD( { CreateDate \@"yy" } , 4 ) } > 0 "28" "29" } } } { SET "NextMonth" { IF { CreateDate \@ "MM" } = 12 "1/97" "{ = { CreateDate \@ "MM"} + 1 }/97 } } { IF { = { REF "Delay" } + { CreateDate \@ "dd" } } <= {REF"DaysInMonth"} {CreateDate \@ "MMMM { = { REF "Delay" } + { CreateDate \@ "dd" } }, yyyy"}{ QUOTE { NextMonth \@ "MMMM" } { = { REF "Delay" } + { CreateDate \@ "dd" } - { REF"DaysInMonth" } }, { IF { CreateDate \@ "MM" } <> 12 { CreateDate \@ "yyyy" } { CreateDate \@ "{ = 1 + { CreateDate \@ "yyyy" } \# "xxxx" }" } } } }" } Downright scary! You can use vba instead. See the links on the page above to go to Paul Edstein's date calculation page if you want to try that route instead. |
#3
|
|||
|
|||
Hi charles
Great thanks for your response. It's hard enough to understand, but I will read out from the link for more try. Thanks Charles Quote:
|
#4
|
|||
|
|||
Solved
Hi
Charles thanks for your enlightenment at the link. for a simple solve I use a field code like this: (if date 24-Sep-13) {={Date \@ "dd"}+1\"00"}-{Date \@ "MMM-yy"} and result will appear 25-Sep-13 Thanks Charles |
#5
|
|||
|
|||
Just out of curiosity – is there no support for epoch dates in Word?
|
#6
|
|||
|
|||
Quote:
The field I gave you was created by an Add-In that is no longer available. The document from Paul Edstein has all sorts of fields that you can copy and modify. |
#7
|
|||
|
|||
Quote:
Epoch dates are a fixture of Unix, I believe. Word is a Microsoft program ported from DOS. I would be amazed if it does support such dating. |
#8
|
|||
|
|||
Final note for Chieps:
There are a number of Date fields in Word. One of those is the SaveDate field. In my example, I used the CreateDate field, which is what I use most. Using Date Fields in Microsoft Word. |
#9
|
|||
|
|||
Excel uses epoch dates, and (pause for quick 'Net search to check) so does .NET. I imagine that the o/s stores date/time as a number and uses an offset, too. Perhaps Word users aren't meant to be doing tricky date arithmetic? <rofl>
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
format a Microsoft Word Document, and need your help! | taylorr | Word | 1 | 02-16-2013 01:54 AM |
Issue with date format in mail merge document | walshjod | Mail Merge | 4 | 11-28-2012 04:46 AM |
Add custom document properties into document | NicBodkin | Word | 8 | 05-05-2011 09:09 AM |
Auto Change Date in Word Document??? | dssxxxx | Word | 2 | 01-06-2011 05:50 AM |