Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add one day to a field code date

Posted on 2007-11-13
3
Medium Priority
?
2,727 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 1000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

824 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