Programatically set the NumPages Property

J

Juan

Hi everyone,

I have a C# Application that, if neccessary, divides a large document into
separate smaller ones. But the first page of the second document must be one
more than the last page of the first document. No problem with that.

The problem is that in the footer of the page, I have a "Page x of y" field,
and the 'x' value is correct, but the y value is the number of pages of the
second document, when it should be the total number of pages of the whole
document.

Is there a way that I can set the value of the number of pages to the valur
that I need?

Thanks, from Spain
 
C

Charles Kenyon

Mark the numpages field in doc1 with a bookmark "TotPages"

Instead of a NumPages field use something along the lines of:

{ = { NumPages } + { INCLUDETEXT "doc1.doc" TotPages } }

You could do something similar with the X part as well so that you do not
have to manually adjust the start of page numbering.

BTW, Word will work with quite large documents. I have one with more than
5000 pages including a Table of Contents that references every page at least
once.
 

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