How to search blank page in word template using Aspose.word

We are having window applicationn and using C# for development.
We do have word template file and it is having blank page.We want to search blank page and want to write data into this blank page.Can you please help us to achive this ?

Hi Atos,

Thanks for your inquiry. Please use the following code snippet to achieve your requirements. I suggest you please read following documentation links.

Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");

DocumentBuilder builder = new DocumentBuilder(doc);
String PageText = "";
LayoutCollector lc = new LayoutCollector(doc);
int pages = lc.GetStartPageIndex(doc.LastSection.Body.LastParagraph);
for (int i = 1; i <= pages; i++)
    ArrayList nodes = GetNodesByPage(i, doc);
    foreach(Paragraph para in nodes)
        PageText += para.ToString(SaveFormat.Text).Trim();
    // Empty Page
    if (PageText == "")
        builder.MoveTo((Paragraph) nodes[0]);
        builder.Writeln("Aspose.Words for .NET");
    PageText = "";
// Get Paragraph nodes by page number
private ArrayList GetNodesByPage(int page, Document document)
    ArrayList nodes = new ArrayList();
    LayoutCollector lc = new LayoutCollector(document);
    foreach(Paragraph para in document.GetChildNodes(NodeType.Paragraph, true))
        if (lc.GetStartPageIndex(para) == page)
    return nodes;