How can I put a footer on the last page and make it a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to create a macro that will insert a footer containing filename and
pathname only on the last page of a document.

Can anyone help?
 
Walter said:
I need to create a macro that will insert a footer containing
filename and pathname only on the last page of a document.

Can anyone help?

You do NOT need a macro. You need a special field in the footer that
displays a result only on the last page, as explained at
http://gregmaxey.mvps.org/Conditional_Headers_Footers.htm. For your purpose,
the field code should be

{ IF {PAGE} = {NUMPAGES} {FILENAME \p} }

The article shows how to create nested fields (fields inside of fields).
 
Back
Top