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

Free Support Forum - aspose.com

Field in Heading. "Error! Bookmark not defined."

In our project we have experienced a problem with headings in a document. If those headings ends with a reference field it will not be added to the table of contents correctly. The TOC will display “Error! Bookmark not defined.” instead of the page number.

This has been tested in Aspose.Words for .NET version ‘14.5’ and ‘14.6’. Both are giving us the "Error! Bookmark not defined."

var doc = new Document();
var db = new DocumentBuilder(doc);

db.InsertField(“TOC”);
db.Writeln();

// Chapter 1.
db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Heading1];
db.Writeln(“Chapter 1”);

db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Quote];
db.Writeln(“value”);

// Chapter 2. Header text ending with a field.
db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Heading1];
db.Write("Chapter 2 ");
db.InsertField(“STYLEREF QUOTE”);
db.Writeln();

db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Normal];
db.Writeln(“Content”);

// Chapter 3. Header text has field in the middle.
db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Heading1];
db.Write(“Chapter “);
db.InsertField(“STYLEREF QUOTE”);
db.Writeln(” 3”);

db.ParagraphFormat.Style = doc.Styles[StyleIdentifier.Normal];
db.Writeln(“Content”);


doc.UpdateFields();

Hi Alexander,

Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10517. We will further look into the details of this problem and keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-10517) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-10517) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(2)