Solved

Automation Field in MSWord...

Posted on 2002-04-02
6
250 Views
Last Modified: 2008-03-10
Hi,

In order to make the footer of a document display informations only on the last page, i added an automation 'field' (IF) in the footer.  Since the syntax of the IF statement is supposed to be... :

IF Expression1 Operator Expression2 TrueText FalseText

...I added this field :

{ IF PAGE = NUMPAGE "LAST" "NOT LAST" }

I tought that on the last page of the document it would be wrote "LAST" and on the other ones the words "NOT LAST", but it seems that all pages display "NOT LAST" event the last one... Is there someone who can tell me what i do wrong ???

Thanks,

Freg.
0
Comment
Question by:freg
  • 3
  • 3
6 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 6913157
Hi freq,

You could try

{ IF PAGE=NUMPAGES "LAST" "NOT LAST" }

take away the spaces and add the S

HTH:O)Bruintje
0
 
LVL 1

Author Comment

by:freg
ID: 6913648
That's ok for the S, i just forgot to write it before...

But no matter on wich page the field appears, it still write 'LAST', as if the condition PAGE=NUMPAGES was always True, even on the last page...

It seems that it just doesn't work !  :-(
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6913818
All right this is a fun one learning somthing new ;)

{IF {PAGE}={NUMPAGES} "LAST" "NOT LAST"}

i had one with true and false that worked, what happens is the fieldcodes have to evaluated to their value and so PAGE and NUMPAGES have to entered as fieldcodes

:O)Bruintje
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:freg
ID: 6913948
It seems that it's still not working... :-(

I did not understood your last sentence.  Could you explain please ?

Merci,

Freg.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 6914392
OK i'll try to make this as clear as possible

-first insert an IF field without anything else in the expression
-then after the IF use ALT+SHIFT+P to insert a Page field
-toggle the fieldcode of the page number
-then you have {IF{PAGE}}
-next type the equal sign then you get {IF{PAGE}=}
-next insert another page field, toggle the fieldcode and change it to NUMPAGES
-now you have something like {IF{PAGE}={NUMPAGES}}
-now you can enter the rest of the expression and end up with
-{IF{PAGE}={NUMPAGES}"True" "False"}

HTH:O)Bruintje
0
 
LVL 1

Author Comment

by:freg
ID: 6915340
Ok, i didn't know that i had to 'insert' a new field for each field type (Page, NumPage).  I was just typing de words without specifying that it was fields.... Thank you so much !

Freg.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Perhaps more familiar to developers who primarily use VBScript than to developers who tend to work only with Microsoft Office and Visual Basic for Applications (VBA), the Dictionary is a powerful and versatile class, and is useful …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now