We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert Page field into Word document starts from specific number using C#

I have a word document. Can I with aspose insert pagenumber and say that the word file should start with 5 istead of 1.

Hi Patrik,

Thanks for your query. I have tired to understand your problem statement and based on my understanding you want to add page number start with your desired number. Please see following code snippet and read following documentation links for your kind reference.

Controlling How Page Numbering is Handled
http://docs.aspose.com/display/wordsnet/PageSetup+Members

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertBreak(BreakType.PageBreak);

builder.InsertBreak(BreakType.PageBreak);

// Restart the page numbering on the start of the source document.

doc.FirstSection.PageSetup.RestartPageNumbering = true;

doc.FirstSection.PageSetup.PageStartingNumber = 10;

builder.InsertField("Page");

// This needs to be called in order to update the new fields with page numbers.

doc.UpdatePageLayout();

doc.Save(MyDir + "AsposeOut.doc");

Hope this helps you. If not, please share some more detail about your issue.