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 / April 2004

Tip: Looking for answers? Try searching our database.

Date field questoin

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Hunt - 12 Apr 2004 19:16 GMT
I know how to put the create date or system date on the word doc. But is
there a way to show the date + 15 days.

Thanks
Charles Kenyon - 12 Apr 2004 19:31 GMT
Yes. A complex field. The following gives you the date 15 days after the
creation date:

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

This field was created using Chris Woodman's Add-In. <URL:
http://www.chriswoodman.co.uk/Delayed%20Dates.htm> I wouldn't recommend
trying to enter it manually. Otherwise, download the document at <URL:
http://www.wopr.com/w3tfiles/10-249902-DateCalc.zip>for good examples of
date field calculations that you can copy and modify to fit.

Signature

Charles Kenyon

See 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 know how to put the create date or system date on the word doc. But is
> there a way to show the date + 15 days.
>
> Thanks
Phil Hunt - 12 Apr 2004 20:03 GMT
Are you serious? It's complex alright.
> Yes. A complex field. The following gives you the date 15 days after the
> creation date:
[quoted text clipped - 24 lines]
> >
> > Thanks
Charles Kenyon - 12 Apr 2004 21:11 GMT
You asked! That is what it takes, primarily because of the complexities of
the Gregorian calendar combined with fields' use of text for dates rather
than the arbitrary number process used in vba. That's why I use the (free)
Add-In to write the field. It is a very straight-forward process. The
document I gave you the link to has even more flexibility but might be
harder to use.
Signature


Charles Kenyon

See 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.

> Are you serious? It's complex alright.
> > Yes. A complex field. The following gives you the date 15 days after the
[quoted text clipped - 4 lines]
> > >
> > > Thanks
Phil Hunt - 12 Apr 2004 21:20 GMT
Thanks. ACtually I create the doc in VB, so I think I just use a bookmark
for this purpose.

> You asked! That is what it takes, primarily because of the complexities of
> the Gregorian calendar combined with fields' use of text for dates rather
[quoted text clipped - 11 lines]
> > > >
> > > > Thanks
Doug Robbins - Word MVP - 13 Apr 2004 07:01 GMT
As you are already making use of vba, use the DateAdd() function.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
> Thanks. ACtually I create the doc in VB, so I think I just use a bookmark
> for this purpose.
[quoted text clipped - 26 lines]
> > > > >
> > > > > Thanks
macropod - 13 Apr 2004 11:32 GMT
Hi Phil,

I concur with Doug's suggestion (use vba's DateAdd), but you can also
download a Word document with field codes (different to what Charles posted)
for doing this an much more from:
http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=249902
(url all one line)

Cheers

> Thanks. ACtually I create the doc in VB, so I think I just use a bookmark
> for this purpose.
[quoted text clipped - 16 lines]
> > > > >
> > > > > Thanks
Phil Hunt - 13 Apr 2004 15:34 GMT
Thanks again.

> Thanks. ACtually I create the doc in VB, so I think I just use a bookmark
> for this purpose.
[quoted text clipped - 16 lines]
> > > > >
> > > > > Thanks
 
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.