Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2016, 04:48 AM
gresziu gresziu is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Novice
Add days to Saved date in Word
 
Join Date: Sep 2016
Posts: 5
gresziu is on a distinguished road
Default Add days to Saved date in Word

Hi there,

I'm trying to add 14 days to the saved date of a Word document but I'm unable to, weird as it seems very strait forward.


I'm following this web page: http://www.gmayor.com/insert_a_date_...than_today.htm as guide for the actual date, but the formula {={Date \@ "dd"}+14} isn't working, when I open the document I see nothing.

I'm entering both curly brackets groups by Ctrl + F9.
It only works when I enter {date} or {savedate}
Reply With Quote
  #2  
Old 09-21-2016, 05:33 AM
Charles Kenyon Charles Kenyon is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

If the date were the September 21, your formula would give you September 35.

Here is the field for 14 days from the CREATEDATE:
{ QUOTE "{ SET " Delay" "14" }
{
SET "DaysInMonth" { IF { CreateDate \@ "MM" } <> 2
{
= ROUND(30.575*
{ CreateDate \@ "MM" },0)-
ROUND(30.575*
{ = { CreateDate \@ "MM" } -1 },0) }
{
IF { = MOD( { CreateDate \@"yy" } , 4 ) } > 0 "28" "29" } } }
{
SET "NextMonth" { IF { CreateDate \@ "MM" } = 12 "1/97"
"
{ = { CreateDate \@ "MM"} + 1 }/97 } }
{
IF { = { REF "Delay" } + { CreateDate \@ "dd" } } <= {REF"DaysInMonth"}
{
CreateDate \@ "MMMM { = { REF "Delay" } + { CreateDate \@ "dd" } }, yyyy"}{ QUOTE { NextMonth \@ "MMMM"
}
{
=
{ REF "Delay" } + { CreateDate \@ "dd" } - { REF"DaysInMonth" } },
{
IF { CreateDate \@ "MM" } <> 12 { CreateDate \@ "yyyy" }
{
CreateDate \@ "{ = 1 + { CreateDate \@ "yyyy" } \# "xxxx" }" } } } }" }


See Date Calculation Tutorial.
Read the introductory parts and then find the field construction you need in the tutorial. You can simply copy it from the tutorial and paste into your document.

Calculated Dates in Microsoft Word using Fields or vba
(This is the page I copied the field from.)
Reply With Quote
  #3  
Old 09-21-2016, 06:16 AM
gresziu gresziu is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Novice
Add days to Saved date in Word
 
Join Date: Sep 2016
Posts: 5
gresziu is on a distinguished road
Default

Thanks Charles, what a big amount of code
Copy and paste and first curly braces with Ctrl + F9 don't work, should I create all curly braces with Ctrl + F9?
Reply With Quote
  #4  
Old 09-21-2016, 06:30 AM
Charles Kenyon Charles Kenyon is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Go to the tutorial. Do not try to reconstruct that field!
The tutorial is a Word document. You can take a field in that document, copy it, and paste it into your own document. Then you can change it to suit.

For instance: CreateDate -> SaveDate
Delay = 14 -> Delay = 21

Yes, all curly braces must be inserted using Ctrl+F9, in pairs. Reconstructing that field manually is virtually impossible. Also, spaces added to make it more readable may change how the field behaves.

If you do not want to use Paul Edstein's tutorial (which you should), you can download an Add-In that will create a field for you from this site:
http://web.archive.org/web/201110310...ed%20Dates.htm That was the original source of the field on my web page.

Paul spent a great deal of effort and used expertise few possess to write his tutorial. I would advise using it. You will tear your hair out trying to write fields that are freely available in the tutorial.Date Calculation Tutorial

If you just want the field I posted above, go to my page Calculated Dates in Microsoft Word using Fields or vba and use the link on that page to download a file that contains that field. I recommend using Paul's instead, though. His tutorial includes a good discussion on how to copy and paste them as well as about formatting differences.

Once you have downloaded Paul's tutorial, you can experiment and learn how these fields work if you want. Here are some of his other tutorials on fields:
Microsoft Word Field Maths Tutorial
Word Fields and Relative Paths to External Files

This stuff is neither straightforward nor simple. It does follow rules but discovering those rules can be a painful process. I feel happy just being able to use a field someone else has constructed and manipulate it to suit my needs.

If needed, there are macros available online (Graham's site) that convert field codes to text and back. Again, because of spacing issues, those would not work with the field I posted above.

www.gmayor.com/export_field.htm
www.gmayor.com/export_field.htm#TextToField
Reply With Quote
  #5  
Old 09-21-2016, 07:05 AM
gresziu gresziu is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Novice
Add days to Saved date in Word
 
Join Date: Sep 2016
Posts: 5
gresziu is on a distinguished road
Default

Thanks again Charles, but I seem not able to copy and paste to my document.
In the tutorial, I see the field quotes with Alt + F9, but I'm not able to see the whole formula, as If I right click and Edit formula, it only gives me the line I clicked.
Also, normal copy and paste of the quote don't work, it shows me the exactly quote code in Word, and in Notepad++, it shows the value (result) of the quote.

How do I copy and paste the quote to my document?
Should I enter the value on the formula field when inserting quick part (field)?
Reply With Quote
  #6  
Old 09-21-2016, 07:11 AM
gresziu gresziu is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Novice
Add days to Saved date in Word
 
Join Date: Sep 2016
Posts: 5
gresziu is on a distinguished road
Default

OMG, sorry for confusion, I was seeing the quotes as I previously clicked Alt + F9..
Reply With Quote
  #7  
Old 09-21-2016, 07:22 AM
Charles Kenyon Charles Kenyon is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

By the way, I would recommend using the CreateDate rather than the SaveDate. This should be in a template. You should not be opening documents and changing them to use them.

Using Date Fields in Microsoft Word

Alt+F9 is a toggle and applies system-wide. Its effects will persist through closing and reopening Word. It changes a Word option.
Reply With Quote
  #8  
Old 09-21-2016, 08:29 AM
gresziu gresziu is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Novice
Add days to Saved date in Word
 
Join Date: Sep 2016
Posts: 5
gresziu is on a distinguished road
Default

Thanks for the info Charles, but I'm using the Word document within MS Dynamics CRM, and the createdate it's when it was uploaded to CRM, so the savedate, will be updated always when users download the document, isn't it?

I have modified the code to show date in format dd/MM/yyyy, but I can't paste here. Should I upload a word document?
Reply With Quote
  #9  
Old 09-21-2016, 08:57 AM
Charles Kenyon Charles Kenyon is offline Add days to Saved date in Word Windows 8 Add days to Saved date in Word Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Quote:
The createdate it's when it was uploaded to CRM, so the savedate, will be updated always when users download the document, isn't it?
I have no idea what MS Dynamics CRM is.

If you use a template and people use the template to create a new document, the createdate is the date the new document is created. Savedate is a bit tricky in that the date is not updated until after the document is saved and may have to be manually updated depending on where in the document the field is kept. Simply saving the document is unlikely to update or change the field.
Templates in Microsoft Word

Quote:
I have modified the code to show date in format dd/MM/yyyy, but I can't paste here. Should I upload a word document?
If it is working for you, there is no need to upload it. If not, try uploading along with a description of the problems you are having. Is it working?

If the source of your field is Paul's tutorial, refer to the section of the tutorial you used as a source.

Last edited by Charles Kenyon; 09-22-2016 at 11:53 AM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add days to Saved date in Word Inserting a formula to count 30 days before and after a date in WORD table bjh894 Word 9 05-18-2020 11:14 AM
Add days to Saved date in Word Date field - future date calculation + only business days neon4 Word 7 01-21-2016 02:21 PM
Add days to Saved date in Word adding days to a date euterpia Excel 1 01-18-2016 07:42 AM
Add days to Saved date in Word How do I get auto-updated "number of days since specified date" on MS word? terry795 Word 16 01-07-2016 04:33 PM
Add days to Saved date in Word Date Field to add 10 Days to Current Date Erbwon Word 6 11-12-2012 06:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft