Footer Questions

D

David Yeager

I'm working in a document that has a different first page
header AND different odd/even page headers.

What I need to do have a footer on every page EXCEPT the
last page of a given document that says something to the
effect of "SEE NEXT PAGE". In other words, "SEE NEXT
PAGE" would happen on every page, and then on the last
page something like "END" would appear.

Since the headers/footers are already broken up, however,
I'm not sure how to due this in VBA. Also, since there
isn't really any "Pages" object or collection in VBA, I
don't know how I could run a loop that puts "SEE NEXT
PAGE" on every page but the last.

Any ideas on how I could accomplish this? TIA..

-Dave
 
D

Dave Lett

Hi Dave,

You don't really need to use VBA for this (you can if you
want, however). You can use nested fields (three of them
in total) to complete the task, as in the following:

{ If { NUMPAGES } = { PAGE } "" "SEE NEXT PAGE" " \*
MERGEFORMAT }


HTH
 
B

Brian

Rather than VBA you may consider inserting fields like this

{ IF { PAGE } < { NUMPAGES } "SEE NEXT PAGE" }

in the footer.

-Brian
 
M

Mark Tangard

Hi Dave,

You need an {IF} field in the footer of the document (or
the footer of its last *section* if it has more than one),
to test whether the page is the last page and produce the
appropriate footer:

{ IF { PAGE } <> { NUMPAGES } "See next page" "" }

As you probably know, you insert the field braces with
CTRL+F9, not with the "{" and "}" keys. As you probably
also know, inserting fields with VBA can be a big purple
challenge, so if that's what you intended (you've posted
this to a VBA newsgroup), I'd say make the above into an
AutoText and have your macro insert *that* in the footer
rather than building the fields`. Way simpler.
 

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