Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

How do I get the year before the savedate of a document?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
OverdooZ - 22 Feb 2005 17:41 GMT
I have got this document that I have to print every year and I want to
automize it.

So, I am creating a template with all things that are nearly the same for
each year. This includes the year it was saved in the header (no problem
there, SaveDate \@YYYY does the trick) but I also need the year before that.
This is my problem, I cannot do any calculations on the SaveDate it seems or
if I can, I must be doing it all wrong.

Can somebody help me out?
Jay Freedman - 22 Feb 2005 18:53 GMT
> I have got this document that I have to print every year and I want to
> automize it.
[quoted text clipped - 6 lines]
>
> Can somebody help me out?

Try nesting the SaveDate field inside a formula field like this:
   { = {SaveDate \@YYYY} - 1 }

To do this, type the = before the SaveDate field and the - 1 after it, then
select the whole thing and press Ctrl+F9.

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

overdoos - 23 Feb 2005 11:27 GMT
Thanks for trying to help me out, however it did not work because it gives me
a syntax error on the '{' that is before the savedate.

Maybe it will help a bit if I mention that I'm running a version of MS Word
2002 SP1 on Windows XP SP1

I'm thankful for every idea that might help get underway.

> > I have got this document that I have to print every year and I want to
> > automize it.
[quoted text clipped - 12 lines]
> To do this, type the = before the SaveDate field and the - 1 after it, then
> select the whole thing and press Ctrl+F9.
Jay Freedman - 23 Feb 2005 19:57 GMT
Both sets of braces in the field have to be field delimiters inserted with
Ctrl+F9 (or through the Insert > Field dialog), not typed { } characters. I
assumed that you already had a working SaveDate field in place.

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org

> Thanks for trying to help me out, however it did not work because it
> gives me a syntax error on the '{' that is before the savedate.
[quoted text clipped - 26 lines]
>> Jay Freedman
>> Microsoft Word MVP          FAQ: http://word.mvps.org
Doug Robbins - 24 Feb 2005 00:12 GMT
Was that { entered from the keyboard or by using Ctrl+F9.  You must enter
all field delimiters by using Ctrl+F9.

If you do that, it will work, regardless of the version of Word or Windows.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Thanks for trying to help me out, however it did not work because it gives
> me
[quoted text clipped - 23 lines]
>> then
>> select the whole thing and press Ctrl+F9.
OverdooZ - 24 Feb 2005 16:56 GMT
Thank you both for the answer. I feel soooo stupid now ;)

I had indeed a working SaveDate, but had been messing with it to get the
previous year working and forgot to put it back to the 'pure' formatted
savedate before I tried your solution.

Anyway, it works like a charm now.

thanks

> Was that { entered from the keyboard or by using Ctrl+F9.  You must enter
> all field delimiters by using Ctrl+F9.
[quoted text clipped - 28 lines]
> >> then
> >> select the whole thing and press Ctrl+F9.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.