Problem with SAVEDATE in a field

A

Aardwerk

I'm working on some templates in Word. In these templates I also inserted a
field (in a textbox) which should automatically generates the saving date.
I used the following command in that certain field: {SAVEDATE \@ "MMMM d'th'
yyyy" \* MERGEFORMAT }

Problem:
After updating the field I see this: XXX 0th 0000 instead of a date. The
real problem is that when I save the template as a Word doc and after opening
this doc again the Date still does not show up like it should or at least not
always.

I'm working and edting the templates on a Mac in Word 2004 and I test it on
both platforms Mac and Windows 200 pro. Both show the same problem.

Does anyone recognize this problem?

Greetz Rob
 
S

Stefan Blom

Text boxes have a problem with many fields. Place the field inside a
single-cell table or a frame instead. You can insert a table from the
Table menu (which is kind of obvious), and you can insert a frame from
the Forms toolbar (which is less obvious).

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
M

Margaret Aldis

Even without the text box problem getting the SAVEDATE to update so it
always truly shows the last saved date isn't easy, though. One solution is
to override the FileSave command with code that saves and then updates
fields (in appropriate stories), though that can be annoying to users who
save and close and get asked to save again. Getting a really a smooth
solution to all circumstances seems to be a surprisingly difficult exercise.

Google Savedate and Update in the groups to get lots of other suggestions.
 
S

Stefan Blom

I see the problem: Saving (naturally) changes the date and time of
save but it doesn't update the field; updating it manually would
"dirty" the document so that Word prompts you to save it again. And
therefore, the SaveDate field is always "one step behind".

--
Stefan Blom
Microsoft Word MVP


in message
 
A

Aardwerk

Thank you very much for your help. I tried both solutions you gave me but
with no better result.

When I open the template in Windows 2000pro I first see the date like it
should, but as soon as I use the tab in order to jump to other fileds for
input the date changes into XXX 0th 0000 again.

Now when I then save this file and open it again I can only get the right
date by first "toggle the field code" and then choose "update field". Which
in my opinion it should have done so automatically.

I do hope you have more solutions for me?

Gr Rob
 
S

Stefan Blom

It should work, with the limitations that Margaret pointed out in her
post. You are talking about tabbing between fields; does that mean
you have a document which is protected for forms?

--
Stefan Blom
Microsoft Word MVP


in message
 
A

Aardwerk

Hi Stefan,

Yes that's correct I have divided the fields in sectors which are here and
there protected. But I notified the message from Margaret as well and this is
clear to me. I have to point out to my client that when they open the file
from the template they have to save it first before they can print it
otherwise there will be no (correct) date on the printer for instance. On the
other hand I noticed that the DATE field is not always updated even after
saving the file and re-opening it again. I read something about updating
fields for this is obviously not automatically done by word. I can't find a
proper way to do so though other than rightmouse click on the date which is a
problem when you've protected the date field with a password.

greetz Rob
 
S

Suzanne S. Barnhill

If "Update fields" is checked on the Print tab of Tools | Options, the
SAVEDATE field should be updated at print time.
 
M

macropod

Hi Aardwerk,
I noticed that you have the date ordinal hard-coded for 'th':
{SAVEDATE \@ "MMMM d'th' yyyy" \* MERGEFORMAT }
Obviously, this won't work with dates like 1st, 2nd, 3rd, 21st, 22nd, 31st.
What will work, with any language, is:
{DATE \@ "MMMM '{DATE \@ d \*Ordinal}' yyyy"}
If you want the ordinals superscripted, see my Date Calculations 'tutorial'
for Word at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=249902

Cheers
 
A

Aardwerk

Thanx Macropod.
Does your field command as you describe it below register the date of saving
or the date of opening the file, cause you mention DATE instead of SAVEDATE?
And another question is that the present SAVEDATE command in my templates
doesn't update the date automatically. So when I open this template from the
templatefolder in Word and then save it, I noticed that when i open it again
it still doesn't show up with the right date (000 xxx 0000). I have to right
click with my mouse on the date and choose update field. Only then it shows
the date of saving. Annoying. This happens in word 2000 on Windows 2000pro
and I don't know whether it does so on other platforms.

Maybe you know an answer?
Greetz Rob
 
M

macropod

Hi Aardwerk,

The SAVEDATE equivalent would be:
{SAVEDATE \@ "MMMM '{SAVEDATE \@ d \*Ordinal}' yyyy"}

For a new document, SAVEDATE will always be invalid until the document has
been saved. Putting the field inside a textbox (or any other shape object),
kills the automatic updating of the SAVEDATE field.

You could overcome that with some vba:
With ActiveDocument
For Each pRange In .StoryRanges
Do
pRange.Fields.Update
Set pRange = pRange.NextStoryRange
Loop Until pRange Is Nothing
Next
End With

This will update all fields in the document, and could be made part of an
auto open macro.

Cheers
 
A

Aardwerk

Due to some extra work I wasn't able to react sooner.

But I still have this question. So obviously the date won't update
automatically. Thus I tried the VB macropod gave me. But then everytime you
open the template you get this requestor whether you want to enable the Macro
which is not a proper way for my client.
Margareth you mentioned something about overriding the filesave command. As
a last resort this could be the best way to do so I guess. I tried but could
you give me a little bit more information on how to do this smoothly?

Thanx very much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top