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 / Programming / August 2006

Tip: Looking for answers? Try searching our database.

Automatically Insert Date + 3

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charles Phillips - 04 Aug 2006 18:31 GMT
Hello,
I have a MS-Word 2003 document that I send out regularly.
The document has the following statement:

"Please return the survey form no later than August 1st".

When I open the document, I want the sys to insert the current date, plus 3
days later.

Example:
When I open the document, the above statement reads:

"Please return the survey form no later than August 4th."

I have looked in several areas, but has had no luck.
Can/will someone point me to some examples or samples of this process???

Thank you,

Charles L. Phillips
Doug Robbins - Word MVP - 04 Aug 2006 21:30 GMT
I am not sure where you want to insert it, but what you need to insert is

Format(DateAdd("d", 3, Date), "MMMM, d")

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
> I have a MS-Word 2003 document that I send out regularly.
[quoted text clipped - 16 lines]
>
> Charles L. Phillips
Charles Phillips - 04 Aug 2006 22:20 GMT
Hello,
Currently, in the file the date is: August 1st
Whenever I open the file, I want the system to take in account the current
system date, add 3 days, then display the result.

Examples:    Current date displayed in file:     August 1st.
                   Current date of computer:         August 5th
                   When file is open, display:         August 8th

I hope there is a little more clear...

I did look into "=DateAdd (used in MS-Access), but was not able to find ANY
reference material with MS-Word, or how to apply in MS-Word

Thank you,

Charles L. Phillips

>I am not sure where you want to insert it, but what you need to insert is
>
[quoted text clipped - 20 lines]
>>
>> Charles L. Phillips
Doug Robbins - Word MVP - 05 Aug 2006 14:06 GMT
What I would do is have a {docvariable varname} field in the document, then
I would use code to set the variable to the required date and update the
fields in the document.

If the document is a template, which I would recommend that it should be,
then the code would be in a macro named autonew() in that template.  If it
is in the document itself, which I do not recommend as you will get a macro
warning message when you open the document if the security level is set to
medium (the minimum recommended) or, if you have it set to high, the code
will just be ignored.

In either case, the code is the same:

With ActiveDocument
   .Variables("vMonth") = Format(DateAdd("d", 3, Date), "MMMM")
   .Variables("vDay") = Format(DateAdd("d", 3, Date), "d")
   .Fields.Update
End With

and in the document, you would have the following fields where you want the
date to appear

{ docvariable vmonth } { docvariable vday \* ordinal }

You must use Ctrl+F9 to insert each pair of field delimiters and Alt+F9 to
toggle off their display.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
> Currently, in the file the date is: August 1st
[quoted text clipped - 38 lines]
>>>
>>> Charles L. Phillips
Charles Phillips - 08 Aug 2006 19:30 GMT
Hello,
This is what I was looking for, but couldn't find ANY kind of reference
material(s).

Thank you,

Charles L. Phillips

> What I would do is have a {docvariable varname} field in the document,
> then I would use code to set the variable to the required date and update
[quoted text clipped - 66 lines]
>>>>
>>>> Charles L. Phillips
Doug Robbins - Word MVP - 04 Aug 2006 21:35 GMT
Or look at  http://www.gmayor.com/insert_a_date_other_than_today.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
> I have a MS-Word 2003 document that I send out regularly.
[quoted text clipped - 16 lines]
>
> Charles L. Phillips
Charles Kenyon - 06 Aug 2006 00:50 GMT
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
utilities to create the fields and an explanation of different macros that
can be used instead of fields. It also has a link to
www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902 which is a document
with various fields already created. Another resource is
http://www.gmayor.com/insert_a_date_other_than_today.htm.

Signature

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://word.mvps.org/FAQs/ 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.

> Hello,
> I have a MS-Word 2003 document that I send out regularly.
[quoted text clipped - 16 lines]
>
> Charles L. Phillips
Charles Phillips - 08 Aug 2006 19:34 GMT
Hello,
This is what I was looking for, but couldn't find ANY kind of reference
material(s).

Thank you,

Charles L. Phillips

> This is more complex than you might imagine, but it can be done. See
> http://addbalance.com/word/datefields2.htm for information on the
[quoted text clipped - 25 lines]
>>
>> Charles L. Phillips
 
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.