Solved

Add one day to a field code date

Posted on 2007-11-13
3
2,664 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

A Knowledge Base That Stays Up-to-Date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
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 …

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now