Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / December 2003

Tip: Looking for answers? Try searching our database.

Date fields in MS Word - Add X days to a date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
marcbackup@marchankin.com - 16 Dec 2003 17:24 GMT
I would like to add X days to a date field.
Is there a way to do that w/o running a macro?
Charles Kenyon - 16 Dec 2003 21:20 GMT
Yes, but the field is _very_ complex. Don't try to type it! You can download
an Add-In that lets you construct such a field. The field itself does not
require any macros. Below is a sample of such a field constructed by the
Add-In.

{ QUOTE "{ SET " Delay" "14" }
{  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" }" } } } }" }

Note that this is all _one_ field (nested fields).

You can download the Add-In from Chris Woodman's site at:
<URL: http://www.chriswoodman.co.uk/Delayed%20Dates.htm>.

Otherwise, here is a document that contains some fields:
<URL: http://www.wopr.com/w3tfiles/10-249902-DateCalc.zip>.

Otherwise you can use macros.
Signature


Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> I would like to add X days to a date field.
> Is there a way to do that w/o running a macro?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.