Updating index content

Hello Aspose team,

I have one question, I have one doc file with index markers (XE fields) and table of contents is generated with that index markers, If I change content form XE fields indexed table of contents need to be updated so changes take effect, my question is is there any way in code to update this table of content? I try to use method in Document class updateFields() without result. Is there any other way?

example
{XE “Some text”} will be generated under S
if get changed to {XE “Lome text”} it suppose to be generated under L but before that it need to be updated (right click >>update field)

I don’t know how to do that in code.

I will send you one file with index markers.

Thanks
Branko

Hi
Thanks for your request. Unfortunately, Aspose.Words does not support updating INDEX fields. However, I think, in your case you can try using TOC instead INDEX and TC instead XE fields. Please see the following code:

// Create document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert TOC
builder.insertTableOfContents("\\f \\h \\z");
builder.writeln();
// Insert few TC fields.
builder.insertField("TC \"item1\" \\l 1");
builder.insertField("TC \"item2\" \\l 1");
builder.insertField("TC \"item3\" \\l 1");
builder.insertField("TC \"item4\" \\l 1");
builder.insertField("TC \"item5\" \\l 1");
builder.insertField("TC \"item6\" \\l 1");
// Update fields.
doc.updateFields();
// Save output
doc.save("C:\\Temp\\out.doc");

Hope this helps.
Best regards,

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

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