Word 2003 auto field update
Hi all,
Bit of a golden oldie for ya! We use Word 2003 and use a field in footer to show the file path of the document, I found out later that the auto field update isn't included in 2003, so I used the MS advice and added the code that does it.
Works a treat.... but our users have found that every time they save a document it updates the field with the new location, and records it as an alteration, which requires another save when they close the doc down, not a major issue, but a slight annoyance, is there a way to re jig the code so as it becomes a part of the save process so as it doesn't require another save?
Code:
Sub UpdateDocFields()
' Called by ModSave:FileSave and FileSaveAs and modOpen:FileOpen
' Updates fields in the active document
' Macro created 08/02/2010 by Robert Morley
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub
Re: Word 2003 auto field update
Why not call the code only in the following sub? This will ensure that you don't have to call it manually?
Code:
Private Sub Document_Close()
End Sub
Re: Word 2003 auto field update
Cheers Koolsid,
Does that mean the close command would be the new save? to be honest that more of less what we told them to do, by default word will ask them to save it if they haven't already. but the flaw in our plan is that we have a custom save frm we would like our staff to use, or they'll end up deleting anything and everything... I know it sounds like we're spoon feeding them :rolleyes:
Re: Word 2003 auto field update
Save I see your save routine?
1 Attachment(s)
Re: Word 2003 auto field update
It's a big one... here goes! :sick:
Edit* Didn't like it please see the attached
Re: Word 2003 auto field update
Use your form to do a save as and then simply call this in the Document_Close event
Code:
ActiveDocument.Save
Re: Word 2003 auto field update
Thanks koolsid,
Alas our users are 1.technophobes and 2. creatures of habbit. if I apply a save into the close, the users will by habbit click save as, filling the necessary then close the doc and be asked to save again. unless you mean that the adding of the activedoc.save removes that prompt and just saves the doc?
Re: Word 2003 auto field update
Quote:
unless you mean that the adding of the activedoc.save removes that prompt and just saves the doc?
Yes. :)
It's something like you do a file save as and then keep on clicking Ctrl + S
What we are doing is a Ctrl + S before closing the document.
Re: Word 2003 auto field update
Thanks Sid,
Alas I've tested it on a user, it works but they raised a good point, if they edit a doc to the point that it would take longer the undo, then to redo, they would normally just close the doc and start over, but this edit would save it even if they don't want to, Nightmare! no worries like I said, it's no biggie, it's only one pop up that just reminds them to save their work, can't remind them anymore then that I guess, the more the merrier lol
Thanks for the help anyways :D
Re: Word 2003 auto field update
OK, if your query is solved then do remember to mark the thread resolved ;)