Solved

Add one day to a field code date

Posted on 2007-11-13
3
2,706 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
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…
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
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…

710 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