Reply
 
Thread Tools Display Modes
  #1   Report Post  
jabrbm
 
Posts: n/a
Default 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   Report Post  
Graham Mayor
 
Posts: n/a
Default

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   Report Post  
Posted to microsoft.public.word.docmanagement
edeaston edeaston is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
edeaston edeaston is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default 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.









Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump


All times are GMT +1. The time now is 06:56 PM.

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"