![]() |
|
||||||||
| Site Links |
| Consulting |
| Knowledge Base |
| Training |
| Forum |
| Articles |
| Resources |
| Products |
| Cool Tools |
| Contact |
| About Us |
| Go to Page... |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
|
word 2007 - automatically update fields in footer after save event
Does anybody know the best practice to automatically update the fields (specifically filename and path field) in a footer after the user clicks save. I thought I had this figured out awhile ago, but apparently I do not.
I have really struggled trying to find something that works and I'm not sure why I can't come up with a solution to what seems like a pretty basic problem. Thanks in advance for any ideas. Brian |
|
Local Time: 11:49 AM
Local Date: 05-22-2013 Location:
|
|
|
|
#2 |
|
|
You could add update coding to the Save event itself. This means writing a FileSave event that includes both the field updating and the saving itself.
|
|
Local Time: 06:49 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#3 |
|
|
VBA:
VBA tags courtesy of www.thecodenet.com
+------+ | David | +------+ |
|
Local Time: 12:49 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#4 |
|
|
Tinbendr, you forgot to do the file saving instruction!
That would do the update...but NOT do the actual saving of the file. The file would NOT be saved. I am not a fan of going through all the StoryRanges, unless actually needed. Going through all the StoryRanges means looping through (assuming there are no Comments, or Endnotes): MainTextStory EvenPagesHeaderStory PrimaryHeaderStory EvenPagesFooterStory PrimaryFooterStory FirstPageheaderStory FirstPageFooterStory in that order. Since (again assuming you do NOT want to check through the Comments story, the EndNotes Story, the FootNotesStory or the TextFrameStory....then why not just action the stories you weant to explicitly? VBA:
VBA tags courtesy of www.thecodenet.com
|
|
Local Time: 06:49 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#5 | |||||||||||||||||||||||
|
|
DOH! ![]() +------+ | David | +------+ |
|||||||||||||||||||||||
|
Local Time: 12:49 PM
Local Date: 05-22-2013 Location:
|
|
|
|
#6 |
|
|
Of course, if you update the fields after saving, the state reverts to unsaved. And if one of those fields is a SAVEDATE field, you'll be chasing your tail forever ...
Cheers Paul Edstein [MS MVP - Word] |
|
Local Time: 04:49 AM
Local Date: 05-23-2013 Location:
|
|
|
|
#7 |
|
|
That macropod, always finding the best part.
Although, that is why I did the update BEFORE the save. Because, then who cares? Except....for that darn SAVEDATE. Good one. |
|
Local Time: 06:49 PM
Local Date: 05-22-2013 Location:
|
|
![]() |
| Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|


