View Single Post
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

On Thu, 14 Apr 2005 10:52:08 -0700, "gardner"
wrote:

We use a template that was created using Word 2003 that has a SAVEDATE field.
When users of the template who use Word 2000 save and close the document,
the SAVEDATE field does not automatically update. We do not want to require
that the users right click on the field to update it manually. Do you have
any suggestions?


That topic was discussed in this newsgroup last month -- see
http://groups-beta.google.com/group/...273f43fb41ed29

If you aren't operating in the sort of paranoid environment that
disables all macros, you can use a pair of them in the template to
update the fields as part of the Save and SaveAs commands. They would
look like this:

Public Sub FileSave()
On Error Resume Next
ActiveDocument.Save

Dim oRg As Range
For Each oRg In ActiveDocument.StoryRanges
oRg.Fields.Update
Do While Not (oRg.Next Is Nothing)
Set oRg = oRg.Next
oRg.Fields.Update
Loop
Next oRg
End Sub

Public Sub FileSaveAs()
On Error Resume Next
Dialogs(wdDialogFileSaveAs).Show

Dim oRg As Range
For Each oRg In ActiveDocument.StoryRanges
oRg.Fields.Update
Do While Not (oRg.Next Is Nothing)
Set oRg = oRg.Next
oRg.Fields.Update
Loop
Next oRg
End Sub

See http://www.gmayor.com/installing_macro.htm for instructions if
needed.

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