Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Path and filenames in footers
I have numerous Word files where I insert the path and filename in the
footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |
#2
|
|||
|
|||
Such fields do not *automatically* update. Update the field manually. A
macro to do this can be found at http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jabrbm wrote: I have numerous Word files where I insert the path and filename in the footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Path and filenames in footers
Hi Graham,
I am being completely stupid here but I followed your link and got the macro to update which works fine but I want to run it when the document is opened but I cant figure out how to add AutoOpen into that Macro - what would you suggest? In case you cant tell I'm no VBA expert... Thanks Ed "Graham Mayor" wrote: Such fields do not *automatically* update. Update the field manually. A macro to do this can be found at http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jabrbm wrote: I have numerous Word files where I insert the path and filename in the footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Path and filenames in footers
Just change the name of the UpdateAll macro to AutoOpen and make sure to
store it in the Normal template: Sub AutoOpen() Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges oStory.Fields.Update If oStory.StoryType wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange oStory.Fields.Update Wend End If Next oStory Set oStory = Nothing End Sub Any fields in any document opened in Word will then update. A possible side-effect is that it will take longer time to open documents (especially long documents with many fields). -- Stefan Blom Microsoft Word MVP "edeaston" wrote in message ... Hi Graham, I am being completely stupid here but I followed your link and got the macro to update which works fine but I want to run it when the document is opened but I cant figure out how to add AutoOpen into that Macro - what would you suggest? In case you cant tell I'm no VBA expert... Thanks Ed "Graham Mayor" wrote: Such fields do not *automatically* update. Update the field manually. A macro to do this can be found at http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jabrbm wrote: I have numerous Word files where I insert the path and filename in the footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Path and filenames in footers
Thanks for that Stefan - its just the answer I was after!
Cheers Ed "Stefan Blom" wrote: Just change the name of the UpdateAll macro to AutoOpen and make sure to store it in the Normal template: Sub AutoOpen() Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges oStory.Fields.Update If oStory.StoryType wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange oStory.Fields.Update Wend End If Next oStory Set oStory = Nothing End Sub Any fields in any document opened in Word will then update. A possible side-effect is that it will take longer time to open documents (especially long documents with many fields). -- Stefan Blom Microsoft Word MVP "edeaston" wrote in message ... Hi Graham, I am being completely stupid here but I followed your link and got the macro to update which works fine but I want to run it when the document is opened but I cant figure out how to add AutoOpen into that Macro - what would you suggest? In case you cant tell I'm no VBA expert... Thanks Ed "Graham Mayor" wrote: Such fields do not *automatically* update. Update the field manually. A macro to do this can be found at http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jabrbm wrote: I have numerous Word files where I insert the path and filename in the footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Path and filenames in footers
You are welcome--and thank you for the feedback.
-- Stefan Blom Microsoft Word MVP "edeaston" wrote in message ... Thanks for that Stefan - its just the answer I was after! Cheers Ed "Stefan Blom" wrote: Just change the name of the UpdateAll macro to AutoOpen and make sure to store it in the Normal template: Sub AutoOpen() Dim oStory As Range For Each oStory In ActiveDocument.StoryRanges oStory.Fields.Update If oStory.StoryType wdMainTextStory Then While Not (oStory.NextStoryRange Is Nothing) Set oStory = oStory.NextStoryRange oStory.Fields.Update Wend End If Next oStory Set oStory = Nothing End Sub Any fields in any document opened in Word will then update. A possible side-effect is that it will take longer time to open documents (especially long documents with many fields). -- Stefan Blom Microsoft Word MVP "edeaston" wrote in message ... Hi Graham, I am being completely stupid here but I followed your link and got the macro to update which works fine but I want to run it when the document is opened but I cant figure out how to add AutoOpen into that Macro - what would you suggest? In case you cant tell I'm no VBA expert... Thanks Ed "Graham Mayor" wrote: Such fields do not *automatically* update. Update the field manually. A macro to do this can be found at http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org jabrbm wrote: I have numerous Word files where I insert the path and filename in the footer. These files are updated weekly and saved as a new filename with a different date. The filename doesn't automatically change in the footer when I do a save as with the new date. |