How to get number of pages in certain section in a word?

Posted by Yesi under C# on 6/3/2015 | Points: 10 | Views : 301 | Status : [Member] | Replies : 1
Hello everyone,

I know how to get number of pages of a whole word. If my Word has more than one sections,and each has their own pages . How to obtain how many pages in certain section using C#? Any ideas ? Thank you .


Posted by: Bnote on: 6/5/2015 [Member] Starter | Points: 25

Using VBA syntax what you need for "section n" is
a. if n
= 1 then you look at


b. if n
> 1 then you establish that section n exists, then look at


and notice that case (b) can return 0 if you have a continuous section break on the last page of section n. I don't know what that would mean in terms of the headers that you would have, but I'd hope it would mean you just had the first page header.

Refered here:

Yesi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response