How do I get the filename to auto update?

G

Guest

On a document I know if you put the filename in as a field code in the footer
it will auto update on saving or printing.

How do I put in a field code on just one page (ie the last page of a
document) and still get the filename to auto update?

Thanks in advance
 
C

Charles Kenyon

Greg has given you the links to have it appear on the last page. To have it
autoupdate, more is required. See
http://gregmaxey.mvps.org/File_Name_And_Path.htm.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Guest

Thanks for your replies, seems pretty complicated will have a go and let you
know how I get on, thanks again.
 
C

Charles Kenyon

While it is complex, if you take it step by step you can do it. The
conditional field, especially, are worth spending the time to learn.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
G

Guest

I don't understand why you wouldn't just insert a NEXT PAGE section break on
the second last page, and then insert a FILENAME with PATH field in footer of
the second section of the document (being sure to remove the SAME AS
PREVIOUS) button. Then if you want the field to update without closing out
of the document you could go to the FOOTER and right click on the field and
ask it to UPDATE FIELD.
 
S

Suzanne S. Barnhill

It is rarely convenient to have a section break interrupting the continuous
text flow between pages.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Thanks for your reply, that is what we do at the moment but unfortunately not
everyone remembers to update the field and it causes all kinds of problems!!
 
G

Guest

Thanks for your reply, unfortunately what Teeder suggested is what we do at
the moment but human error takes over and some people dont update the fields
which causes all kinds of problems. We used to use Wordperfect which auto
updated the path and filename and I think that some people still forget that
Word doesnt auto update unless its a field code.

Nikki
 
G

Graham Mayor

I suppose you could always intercept the Save and SaveAs commands *in the
particular document template* to add the code to update the field. I have
used the simple switch to print preview and back method here which works for
this particular task and I have added a line to put the filename in the
document window caption.

You need to add a conditional field in the header/footer to put the filename
on the last page only. No section breaks needed.

i.e. {IF {Page} = {Numpages} "{FILENAME \p }"}


Sub FileSaveAs()
Dialogs(wdDialogFileSaveAs).Show
Options.UpdateFieldsAtPrint = True
Application.ScreenUpdating = False
PrintPreview = True
PrintPreview = False
ActiveDocument.ActiveWindow.View.Type = wdPrintView
Application.ScreenUpdating = True
ActiveWindow.Caption = ActiveDocument.FullName
End Sub
Sub FileSave()
Options.UpdateFieldsAtPrint = True
Application.ScreenUpdating = False
PrintPreview = True
PrintPreview = False
ActiveDocument.ActiveWindow.View.Type = wdPrintView
Application.ScreenUpdating = True
ActiveDocument.Save
ActiveWindow.Caption = ActiveDocument.FullName
End Sub

Should do the trick http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

My reply was addressed to Teeder's suggestion of inserting a section break,
which is impractical. It is much more sensible to use a conditional field,
as originally suggested, to put the FILENAME in the footer for the last page
only. This has no bearing whatsoever on whether the filename updates (it
won't update any more or less if it's in a separate section). All fields in
the header and footer are updated on printing (regardless of the Print
Options setting), but filename fields are not updated on saving or even
(after recent SPs) on reopening, so a macro is required to force them to
update.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top