Free Support Forum - aspose.com

Page Number Error

Hi All,

I'm trying to print page numbers dynamically to a footer using aspose.word, but I'm getting a error messgage as an output.

DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField("PAGE", "");
builder.Write(" of ");
builder.InsertField("NUMPAGES", "");

I'm doing something simple and others have reported it works for them. But not for me, I error messge.

"Error! Number cannot be represented in specified format. of 4"!

It should have outputed "1 of 4" or "2 of 4";

Can someone tell me why I'm getting this error message?

thanks: Jim


Hi Jim,

Thanks for reporting this error to us.

Please provide some additional information: the version number of Aspose.Words that you are using and also full text or screenshot of exception that you are getting.

Best regards,