Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2013, 10:31 PM
Chieps Chieps is offline Document properties in word - date format Windows XP Document properties in word - date format Office 2007
Novice
Document properties in word - date format
 
Join Date: Jun 2013
Posts: 4
Chieps is on a distinguished road
Unhappy 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
Reply With Quote
  #2  
Old 09-24-2013, 12:15 PM
Charles Kenyon Charles Kenyon is offline Document properties in word - date format Windows Vista Document properties in word - date format Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.

Reply With Quote
  #3  
Old 09-24-2013, 08:06 PM
Chieps Chieps is offline Document properties in word - date format Windows XP Document properties in word - date format Office 2007
Novice
Document properties in word - date format
 
Join Date: Jun 2013
Posts: 4
Chieps is on a distinguished road
Wink

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:
Originally Posted by Charles Kenyon View Post
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.

Reply With Quote
  #4  
Old 09-24-2013, 09:49 PM
Chieps Chieps is offline Document properties in word - date format Windows XP Document properties in word - date format Office 2007
Novice
Document properties in word - date format
 
Join Date: Jun 2013
Posts: 4
Chieps is on a distinguished road
Thumbs up 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
Reply With Quote
  #5  
Old 09-24-2013, 11:13 PM
eNGiNe eNGiNe is offline Document properties in word - date format Windows 7 32bit Document properties in word - date format Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Just out of curiosity – is there no support for epoch dates in Word?
Reply With Quote
  #6  
Old 09-26-2013, 03:33 PM
Charles Kenyon Charles Kenyon is offline Document properties in word - date format Windows Vista Document properties in word - date format Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by Chieps View Post
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
But try it if the date is 30-Sep-13. Then your result will appear 31-Sep-13!

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.
Reply With Quote
  #7  
Old 09-26-2013, 03:37 PM
Charles Kenyon Charles Kenyon is offline Document properties in word - date format Windows Vista Document properties in word - date format Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
Originally Posted by eNGiNe View Post
Just out of curiosity – is there no support for epoch dates in Word?
I had to Google that.

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.
Reply With Quote
  #8  
Old 09-26-2013, 03:42 PM
Charles Kenyon Charles Kenyon is offline Document properties in word - date format Windows Vista Document properties in word - date format Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,125
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
  #9  
Old 09-26-2013, 11:37 PM
eNGiNe eNGiNe is offline Document properties in word - date format Windows 7 32bit Document properties in word - date format Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

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>
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Document properties in word - date format format a Microsoft Word Document, and need your help! taylorr Word 1 02-16-2013 01:54 AM
Document properties in word - date format Issue with date format in mail merge document walshjod Mail Merge 4 11-28-2012 04:46 AM
Document properties in word - date format Add custom document properties into document NicBodkin Word 8 05-05-2011 09:09 AM
Document properties in word - date format Auto Change Date in Word Document??? dssxxxx Word 2 01-06-2011 05:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft