Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Kim W. via OfficeKB.com Kim W. via OfficeKB.com is offline
external usenet poster
 
Posts: 1
Default Date field only update if document has been updated

Ok, this may be simple... but I haven't figured it out yet. I only want the
date/time field in my footer to update if a change to the document has been
made. I don't want it to change when the document opens. I don't want it to
change when it's printed. I don't need the createdate field... that doesn't
work... so.. is there anything I can do?

Thanks!

Kim

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/201004/1

  #2   Report Post  
Posted to microsoft.public.word.newusers
Terry Farrell Terry Farrell is offline
external usenet poster
 
Posts: 2,904
Default Date field only update if document has been updated

Use the SaveDate field then.

--
Terry Farrell - MSWord MVP

"Kim W. via OfficeKB.com" u40534@uwe wrote in message
news:a69315050824e@uwe...
Ok, this may be simple... but I haven't figured it out yet. I only want
the
date/time field in my footer to update if a change to the document has
been
made. I don't want it to change when the document opens. I don't want it
to
change when it's printed. I don't need the createdate field... that
doesn't
work... so.. is there anything I can do?

Thanks!

Kim

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/201004/1

  #3   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Date field only update if document has been updated

You could use the savedate field. However most fields do not update
automatically and if you updated the savedate field after saving to display
its revised content, the document would need to be saved again ad infinitum.
It should however show the correct date the next time the document is
opened.

You could work around this with a couple of macros in the document template,
then replace the field in the document with the docvariable field {
DocVariable varSaveDate }. The macros update a document variable with the
current date before saving. You can change the date formatting switches
"dd/MM/yyyy" to suit your local preference.

http://www.gmayor.com/installing_macro.htm

Sub FileSave()
Dim oVars As Variables
Dim oField As Field
Set oVars = ActiveDocument.Variables
oVars("varSaveDate").Value = Format(Date, "dd/MM/yyyy")
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldDocVariable Then
oField.Update
End If
Next oField
On Error Resume Next
ActiveDocument.Save
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

and

Sub FileSaveAs()
Dim oVars As Variables
Dim oField As Field
Set oVars = ActiveDocument.Variables
oVars("varSaveDate").Value = Format(Date, "dd/MM/yyyy")
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldDocVariable Then
oField.Update
End If
Next oField
On Error Resume Next
Dialogs(wdDialogFileSaveAs).Show
ActiveWindow.Caption = ActiveDocument.FullName
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Kim W. via OfficeKB.com" u40534@uwe wrote in message
news:a69315050824e@uwe...
Ok, this may be simple... but I haven't figured it out yet. I only want
the
date/time field in my footer to update if a change to the document has
been
made. I don't want it to change when the document opens. I don't want it
to
change when it's printed. I don't need the createdate field... that
doesn't
work... so.. is there anything I can do?

Thanks!

Kim

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...neral/201004/1



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving original date of a "date updated" document. Phil DeProtine Microsoft Word Help 1 September 21st 08 02:15 PM
Date field doesn't update Anderflash Mailmerge 5 March 21st 07 02:01 PM
Update Date Field When Document Opens SF New Users 2 October 3rd 05 04:08 PM
How do I lock date field so it is not updated after merge? Dennis Mailmerge 1 July 7th 05 06:53 PM
How do i update a word document date field with a future date al Microsoft Word Help 2 December 6th 04 08:41 AM


All times are GMT +1. The time now is 05:04 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"