Reply
 
Thread Tools Display Modes
  #1   Report Post  
mfelps2
 
Posts: n/a
Default Can a date be generated based on another date in the document

I have a template we use and the currrent date is entered into a field and we
would like for another field to have a date in the future (months or years)
based on the current date
  #2   Report Post  
Michael_Corral
 
Posts: n/a
Default

I would do this document in Excel where I know you can do this. Also
remember, Excel prints out just like Word does.
--
Top Notch Admin


"mfelps2" wrote:

I have a template we use and the currrent date is entered into a field and we
would like for another field to have a date in the future (months or years)
based on the current date

  #3   Report Post  
Dian D. Chapman, MVP
 
Posts: n/a
Default

You can use the code below to do what you want:

ActiveDocument.FormFields("myDate").Result = _
Format((Date + 7), "m/d/yy")

To test the above code...add a TextBox form field into a document.
Double click the form field and set the bookmark name to myDate. Then
run this code. This will insert the date 7 days from now into the form
field.

If you are using a date field now, just remove that and insert a form
field and use the code as needed...modifying the + 7 to whatever
advanced days you need and "m/d/yy" to whatever format you want.

You can also do this with a bookmarked location. Insert a bookmark
where the date should go...then run your code. However, in that case
(if you use a bookmark), you'll need to use this version of the code,
since it's no longer a form field...

Selection.GoTo What:=wdGoToBookmark, Name:="myDate"
Selection.InsertAfter Format((Date + 7), "m/d/yy")

Note...for more info on Forms creation...see this link:

Word AutoForm Articles
http://www.mousetrax.com/techpage.html#autoforms

Dian D. Chapman, Technical Consultant
Microsoft MVP, MOS Certified
Editor/TechTrax Ezine

Free MS Tutorials: http://www.mousetrax.com/techtrax
Free Word eBook: http://www.mousetrax.com/books.html
Optimize your business docs: http://www.mousetrax.com/consulting
Learn VBA the easy way: http://www.mousetrax.com/techcourses.html




On Tue, 17 May 2005 16:19:46 -0700, "mfelps2"
wrote:

I have a template we use and the currrent date is entered into a field and we
would like for another field to have a date in the future (months or years)
based on the current date


  #4   Report Post  
Graham Mayor
 
Posts: n/a
Default

Calculations of dates using date fields is quite complicated, however the
work has already been done for you - see
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




mfelps2 wrote:
I have a template we use and the currrent date is entered into a
field and we would like for another field to have a date in the
future (months or years) based on the current date



  #5   Report Post  
macropod
 
Posts: n/a
Default

Hi,

To see how to do this, go to:
http://www.wopr.com/cgi-bin/w3t/show...&Number=249902
(url all one line)
Where you can download a Word document that uses fields to do this and much
more with dates. No macros required!!

Cheers

"mfelps2" wrote in message
...
I have a template we use and the currrent date is entered into a field and

we
would like for another field to have a date in the future (months or

years)
based on the current date





  #6   Report Post  
Charles Kenyon
 
Posts: n/a
Default

This is more complex than you might imagine, but it can be done. See
http://addbalance.com/word/datefields2.htm for information on the different
kinds of ways to make a date calculation work. It includes links to pages
with fields and an explanation of different macros that can be used instead
of fields.

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

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

See also the MVP FAQ: 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.

"mfelps2" wrote in message
...
I have a template we use and the currrent date is entered into a field and
we
would like for another field to have a date in the future (months or
years)
based on the current date



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to keep date issued (not created) on protected form? Seagull Microsoft Word Help 2 June 24th 05 09:57 PM
Insert Date of Creation BadgerWI New Users 3 May 3rd 05 07:45 PM
How do I insert a current date in a template and then keep this i. Chrissy Microsoft Word Help 5 March 17th 05 12:42 AM
using date field in merge Henri Vrancken Mailmerge 3 March 5th 05 01:52 PM
How to insert future date based on current date plus 14 days John Bakker Microsoft Word Help 1 January 31st 05 09:08 PM


All times are GMT +1. The time now is 07:33 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"