Page numbering with Merged Document and IF statements

Joined
Oct 19, 2021
Messages
14
Reaction score
0
I am looking to add the page number and a 'continued on next page' if there is a next page within the footer of a document. The merge document I have constructed is essentially a questionnaire that can be sent to multiple different entities. So the first page is standard and will be printed for all instances of the document, however the actual questions vary depending on the entity type. (ie whether it's being sent to an individual or a business).

This document is being constructed for use with a database, where information is stored, with the appropriate information being pulled into the document upon merge/creation.

Because of the way the database program works I am needing to use IF statements to account for the various versions of questions that will be included within the document. So essentially page 1 of the document prints in all cases, and IF the recipient is an individual, then page 2a, 3a, & 4a print, ELSE IF the recipient is a business, then page 2b, 3b, & 4b will print. Another way to explain this, I have a document that is 7 pages long, pages 2 through 7 are contained within a nested IF statement, so depending on the criteria of that IF statement, either the text on pages 2 through 4 will print, or the text on pages 5 through 7 will print. But regardless of whether it's pages 2-4 or 5-7, I am looking to have the page number print as pages 1 - 3 (not printing page number on first page of document)

The problem seems to be that when the IF statements are used, that the { PAGE } and { NUMPAGES } function fields will not work (currently nothing is printing) in the footer of the document. When there are no IF statements then the field coding works fine, but then I am either printing all variations of the questions, or needing to create a completely separate document for each possible version, which I am hoping to avoid. I am guessing that this may be due to the order that things are merged/compiled, but am not sure?

I tried using { INCLUDETEXT }, and the page numbers worked, however the rest of the document did not merge correctly. I believe due to the use of the { ASK } function field to allow the user to select the recipient of the document. Again this appears to be the order in which tings are merged but I am not certain.

In Summary: I have a multiple paged document (currently 27 pages) of which most is enclosed within nested IF statements allowing for only parts of that document to print. Which parts print depend on data input by the user upon creating the document using an { ASK } function field. Somewhere between 3-5 pages will print for each true IF statement, and I want the page number(s) for the pages being printed (as well as the total pages being printed) to be printed in the footer of each page starting with the second page.

Appreciate any help or tips.

Thanks,
A Fish
 
Joined
Oct 19, 2021
Messages
14
Reaction score
0
I was able to accomplish what I wanted to do by following the tips found here.

Essentially The fix is to have a single document that holds all of the questions/formatting variations, then set up each version of question as a bookmark. By using { INCLUDETEXT } to reference that document, and then using an IF statement within the { INCLUDETEXT } (didn't even know this was a thing) to select the appropriate bookmark based upon the variable input by the user, I am able to pull in only the wording/questions that I want.

Using this method allows the { PAGE } fields to work as expected, so whether there are 2 pages of questions or 5, the number of pages displays correctly.
 

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