Thanks for you response,My main problem is that all documents are in one batch, I tried the solution you suggested, but it is not reseting the page number.My progress now is: I could calculate the total number of pages of each document which will show only in the first only first header of each docu...