Footer

A

Aurora

I am using Word 2000

I had a macro that would go to the last page of my
document and insert the document filename and path in the
footer. My hard drive died a couple of weeks ago and I
lost the footer. I have tried to re-create the macro, but
it is puting the filename/path on all of the pages. I
only want it on the last page of a document. I checked
the headers/footers box to "different first page". This
kept the filename off the first page but it still appears
on all of the other pages. I only want it to appear on
the last page. I know I had this problem before, and
someone out here helped me. Can you please help me again.

thank you - Aurora
 
S

Suzanne S. Barnhill

You don't need a macro, just a field, as follows:

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

Aurora

But I do not know what the number of the last page will be
as it will differ with every document.

aurora
 
S

Suzanne S. Barnhill

You do not need to know the number of the last page. I see that you do not
understand the field that I provided for you, so let's examine it:

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

IF: The overall field is an IF field. It sets up a condition to be met. If
that condition is met, specific text will be inserted in the footer.

{ PAGE } This is a page number field. It represents the current page number
on a given page.

{ NUMPAGES } This field represents the total number of pages in the
document.

{ FILENAME \p } This is the field that supplies your filename and path.

So what this field is doing is asking, on every page of your document, "Is
the page number the same as the number of pages?" If the answer is no,
nothing is printed. When the answer is yes (on the last page), then your
filename and path are printed.

To insert the field, View | Header and Footer, click the Switch Between
Header and Footer button on the Header and Footer toolbar, position your
insertion point where you want the filename and path to appear, and do the
following:

1. Press Ctrl+F9. This will insert a pair of field delimiters. Although they
are represented by braces, they cannot be typed from the keyboard.

2. Between the braces, type "IF" (without the quotation marks).

3. Click the Insert Page Number button on the Header and Footer toolbar.
This will insert the { PAGE } field.

4. Type "=" (without the quotation marks).

5. Click the Insert Number of Pages button on the H&F toolbar. This will
insert the { NUMPAGES } field.

6. From the AutoText menu on the H&F toolbar, choose "Filename and path."

This completes your field.
 
D

Daiya Mitchell

That's fine. You can safely put the field in the footer for every page,
because the field will only activate when the page number is equivalent to
the number of pages. That's what the IF at the beginning means.

Also note that you have to type the braces by hitting control-F9.
 
A

Aurora

This is what I put in:
{ IF { 3 } = {4 } { U:\NetDocs\__WordDocs\TestData.doc } }

I used a 4 page document. Selected "Header/Footer".
Switched to Footer and typed in the formula above. I used
Control F9 for all of the brackets. From the footer
toolbar, I used "#" where the 3 is, I used the "++" where
the 4 is and selected "filename and path" from the auto
text on the toolbar.

But this still did not work. It printed the information
on all of the pages.

What am I doing wrong?

Aurora
 
S

Suzanne S. Barnhill

You've overdone it. You don't need to press Ctrl+F9 to get the braces around
the fields you insert with the buttons; word creates those as part of the
field. If you will press Alt+F9, you'll see that what you actually now have
is:

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

I'm not surprised that Word is confused!
 
R

Robert M. Franz

Hi Aurora
This is what I put in:
{ IF { 3 } = {4 } { U:\NetDocs\__WordDocs\TestData.doc } } [..]
But this still did not work. It printed the information
on all of the pages.

What am I doing wrong?

There are at least some '"' missing in your formula above (around the
"THEN" part of this "IF-THEN[-ELSE]" construct. Check the syntax of the
IF field in your help, this should point you in the right direction.

Greetinx
..bob
 
R

Robert M. Franz

Robert M. Franz wrote:
[..]
Check the syntax of the
IF field in your help, this should point you in the right direction.

Something that I should have done: Word 2003 doesn't talk about the """
anymore, and possibly they were never needed at all.

Sorry for the wrong lead -- see Suzanne's answer!

..bob
 
S

Suzanne S. Barnhill

The quotes are needed when the TrueText or FalseText is text but not if it
is a field. It doesn't hurt to have the quotes around a field, and of course
you need them if you combine text and a field.



Robert M. Franz said:
Robert M. Franz wrote:
[..]
Check the syntax of the
IF field in your help, this should point you in the right direction.

Something that I should have done: Word 2003 doesn't talk about the """
anymore, and possibly they were never needed at all.

Sorry for the wrong lead -- see Suzanne's answer!

.bob
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word
 
G

Graham Mayor

You don't *need* the quotes around fields, but it certainly makes the
construction easier to follow if you use them as a matter of course.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


The quotes are needed when the TrueText or FalseText is text but not
if it is a field. It doesn't hurt to have the quotes around a field,
and of course you need them if you combine text and a field.


Robert M. Franz said:
Robert M. Franz wrote:
[..]
Check the syntax of the
IF field in your help, this should point you in the right direction.

Something that I should have done: Word 2003 doesn't talk about the
""" anymore, and possibly they were never needed at all.

Sorry for the wrong lead -- see Suzanne's answer!

.bob
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word
 
S

Suzanne S. Barnhill

I agree, but the first time I posted an IF field with quotes around a field
used as TrueText, someone chided me for including unnecessary characters.
<g>



Graham Mayor said:
You don't *need* the quotes around fields, but it certainly makes the
construction easier to follow if you use them as a matter of course.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


The quotes are needed when the TrueText or FalseText is text but not
if it is a field. It doesn't hurt to have the quotes around a field,
and of course you need them if you combine text and a field.


Robert M. Franz said:
Robert M. Franz wrote:
[..]
Check the syntax of the
IF field in your help, this should point you in the right direction.

Something that I should have done: Word 2003 doesn't talk about the
""" anymore, and possibly they were never needed at all.

Sorry for the wrong lead -- see Suzanne's answer!

.bob
--
/"\ ASCII Ribbon Campaign | MS
\ / | MVP
X Against HTML | for
/ \ in e-mail & news | Word
 

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