Hi,
I have an issue with Document.Range.Replace function. It gives an exception “Object reference not set to an instance of an object” for a regular expression “\f” ( to find the form section/page breaks in a document). Please find the code below.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("This is a test document to validate Section Breaks.");
builder.Write(ControlChar.SectionBreak);
builder.Write("End of the documnent.");
doc.Range.Replace(r, this, true);
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("This is a test document to validate Page Breaks.");
builder.Write(ControlChar.SectionBreak);
builder.Write("End of the documnent.");
doc.Range.Replace(new Regex("\f"), this, true); // runtime error here
Please help me.
Thanks.