Free Support Forum - aspose.com

Cycle Through Page Collection?

Hi All,


I’m hesitant to post this question, because it seems like it should be very easy. However, here is the short version:

After creating a Aspose.Words.Document, I would like to cycle through the pages and add an image to each page. However, I cannot figure-out how to access a collection of pages (like you can with Aspose.Pdf.Documents). So, I specifically need to:
  1. Cycle through a collection of pages.
  2. And add an image to each page.
Here’s a little more background info: I am currently doing this successfully by cycling through a collection of Aspose.Pdf.Document.Pages. However, I need to do quite a bit of conversion to make this work, and I’d love to save the processing.

Any help would be greatly appreciate.

Jim

Hi Jim,


Thanks for your inquiry and sorry for the delayed response.

There is no “Page” concept in Microsoft Word documents. Pages are created by Microsoft Word on the fly and unfortunately there is no built-in method you can use to iterate through pages.

In case you want to repeat the same image on every page in Word document then you can achieve this with the help of Headers/Footers. I would suggest you please read the following article:
http://www.aspose.com/docs/display/wordsnet/How+to++Add+a+Watermark+to+a+Document

I hope, this helps.

Best regards,