Solved

Add one day to a field code date

Posted on 2007-11-13
3
2,692 Views
Last Modified: 2008-11-04
I have the following field code: {TIME  \@ "MMMM d, yyyy" }

How can I add one day to this date?  I am always creating a letter the night before and would like to have the next days date on the letter that I will be mailing out the letter.

Thank you.
0
Comment
Question by:thandel
  • 2
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 250 total points
ID: 20278430
I would say No. It is too difficult. There is no in-built date arithmetic in Word Fields, so you have to calculate when the day rolls over to the next month and the next year.

However, there are some brave people who do that sort of thing:

This site has a zipped Word document that you can download with many date calculations
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902.

Look for the field under "Calculate a day, date, month and year, using n days delay". Use the Alt + F9 toggle to see/hide the field codes. You can copy and paste it into your document, but we can only paste the result into here. It is pre-set to 14 days hence, so you need to edit that to a 1 when the code is visible. Don't forget that fields need to be updated to perform their calculation.

Note that it comprises an outer field with 32 other fields nested at various depths within it.


Personally, I would have a simple macro like this:

Sub Tomorrow()
    Selection.Text = Format$(DateAdd("d", 1, Now), "Long Date")
End Sub

and set up a keystroke shortcut (Tools/Customize) to insert it.
0
 

Author Comment

by:thandel
ID: 20296523
Instead of a key stroke could I some how have your macro run or insert into a bookmark when the document opens?
0
 

Author Comment

by:thandel
ID: 20296536
Nevermind, I use the date calculations word file... very impressive!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question