Dynamically update list of figures and list of tables

section is present.
Please find below code, which we have used, for appending multiple word documents to master document:

Aspose.Words.Document genratedDocFrag = new Aspose.Words.Document(appendfile);
DocumentBuilder builder = new DocumentBuilder(genratedDocFrag);
DocumentBuilder docBuilderTemp = new DocumentBuilder(MasterTemplateDoc);
docBuilderTemp.MoveToDocumentEnd();
docBuilderTemp.InsertBreak(BreakType.SectionBreakNewPage);
foreach (Aspose.Words.Section srcSection in genratedDocFrag)
{
    Aspose.Words.Section newSection = (Aspose.Words.Section)MasterTemplateDoc.ImportNode(srcSection, true, ImportFormatMode.UseDestinationStyles);
    MasterTemplateDoc.LastSection.AppendContent(newSection);
}
MasterTemplateDoc.UpdateFields();
MasterTemplateDoc.Save(outputFileName);

In above code we have used UpdateFields() which dynamically update table of content but not list of figure and list of table.if we manually update list of figure(TOF) and list of table in MS Word then it will update.
So is there any way that we can use for updating list of figures and list of table in our master document through code or dynmically.
Please find attched files for your reference:

  1. Master Document
  2. Append word file(word_Doc.docx)
  3. Output Document

Please let us know if any solution is available.
Thanks
Samanvay.

Hello
Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words for .NET 10.5.0. You can download this version from here:
https://releases.aspose.com/words/net
I use the following code for testing:

Document MasterTemplateDoc = new Document("C:\\Temp\\MasterDocument.docx");
Document genratedDocFrag = new Document("C:\\Temp\\WordDoc.docx");
DocumentBuilder builder = new DocumentBuilder(genratedDocFrag);
DocumentBuilder docBuilderTemp = new DocumentBuilder(MasterTemplateDoc);
docBuilderTemp.MoveToDocumentEnd();
docBuilderTemp.InsertBreak(BreakType.SectionBreakNewPage);
foreach (Aspose.Words.Section srcSection in genratedDocFrag)
{
    Aspose.Words.Section newSection = (Aspose.Words.Section)MasterTemplateDoc.ImportNode(srcSection, true, ImportFormatMode.UseDestinationStyles);
    MasterTemplateDoc.LastSection.AppendContent(newSection);
}
MasterTemplateDoc.UpdateFields();
MasterTemplateDoc.Save("C:\\Temp\\out.docx");

Best regards,

Hi,

We are using Aspose.Words.dll version 10.5.0.0 for merging or appending multiple word document to a one master document.

In master document there is a one section in which List of figure, list of table and table of contain items is present.

Please find below code, which we have used, for appending multiple word documents to master document:

Aspose.Words.Document genratedDocFrag = new Aspose.Words.Document("InputWord.docx");
DocumentBuilder builder = new DocumentBuilder(genratedDocFrag);
DocumentBuilder docBuilderTemp = new DocumentBuilder("MasterDocument.docx");
docBuilderTemp.MoveToDocumentEnd();
docBuilderTemp.InsertBreak(BreakType.SectionBreakNewPage);
foreach(Aspose.Words.Section srcSection in genratedDocFrag)
{
    Aspose.Words.Section newSection = (Aspose.Words.Section) MasterTemplateDoc.ImportNode(srcSection, true,
        ImportFormatMode.UseDestinationStyles);
    MasterTemplateDoc.LastSection.AppendContent(newSection);
}
MasterTemplateDoc.UpdateFields();
MasterTemplateDoc.Save("ASPOSEoutputDoc.docx");

In above code we have used UpdateFields() which dynamically update table
of content and list of figure and table in master document after all docs are merged to it.but it does not properly update the table of content for small heading(PFA ASPOSEoutputDoc.docx) and also not display font color(color is gray it should be black) properly. when we manually update lits of figure(TOF)
and list of table in MS Word then looks properly.

So is there any way that we can use for updating list of figures and list of table in our master document through code.

Please let us know if any solution is available.

Thanks

Samanvay.

Hello
Thanks for your request. I cannot reproduce the problem on my side. The document produced by Aspose.Words (using your code) looks the same as MS Word document. I see "No table of contents entries found" after updating fields in MS Word.
Could you please create simple application which will allow me to reproduce the problem on my side?
Best regards,

Hi
Thank you for additional information. I still cannot reproduce the problem on my side. Could you please create simple application which will allow me to reproduce the problem on my side and attach it here?
Best regards,

Hi,

I think there is some misunderstanding, actually we are facing problem in “Table Of Contents” not “LOF and LOT”.

Since there are no switches defined “LOF and LOT” will not update on right click, only TOC will update.

And we have problem in “TOC” section.

Please find the attached files. Please refer the previous threads for the code we used

Thanks,

Samanvay

Hello
Thank you for additional information. I cannot reproduce the problem on my side. The document produced by Aspose.Words (using your code) looks the same as MS Word document. I see “No table of contents entries found” after updating fields in MS Word.
Could you please create simple application which will allow me to reproduce the problem on my side?
My code is:

Document MasterTemplateDoc = new Document("C:\\Temp\\Master+Document.docx");
Document genratedDocFrag = new Document("C:\\Temp\\InputWord.docx");
DocumentBuilder docBuilderTemp = new DocumentBuilder(MasterTemplateDoc);
docBuilderTemp.MoveToDocumentEnd();
docBuilderTemp.InsertBreak(BreakType.SectionBreakNewPage);
foreach(Section srcSection in genratedDocFrag)
{
    Section newSection = (Section) MasterTemplateDoc.ImportNode(srcSection, true, ImportFormatMode.UseDestinationStyles);
    MasterTemplateDoc.LastSection.AppendContent(newSection);
}
MasterTemplateDoc.UpdateFields();
MasterTemplateDoc.Save("C:\\Temp\\out.docx");

I also attached my output document. Hope this helps.
Best regards,

Hi,

Please find the attached sample application that will reproduce the above problem.

Just run the application and click the generate button.

The “MasterDocument” folder contains the MasterDocument The “InputDocument” folder conatins the document that are merged with the MasterDocument The generated document can be found in the “OutputDocument” folder of the application.

Please let us know the solution asap.

Thanks,
Samanvay

Hello
Thank you for additional information. I managed to reproduce the problem on my side. You will be notified as soon as it is fixed.
Best regards,

Hi

I hope you’re doing well. Are you able to reproduce
the problem at your end? Did you get any solution for this? It would be great
help; if you provide the solution as soon as possible.

Thanks
Samanvay.

Hello
Thanks for your inquiry. At the moment this issue is pending for analysis. The responsible developer will analyze the issue and we will be able to provide you an estimate.
Best regards,

Hi

I hope you’re doing well. Are you able to reproduce
the problem at your end? Did you get any solution for this? It would be great
help; if you provide the solution as soon as possible.

Thanks
Samanvay.

Hello
Thanks for your request. As I mentioned earlier, this issue is pending for analysis. The responsible developer will analyze the issue and we will be able to provide you additional information. Sorry for inconvenience.
Best regards,

Hi,

Please let us know the approximate time you need to fix this issue. This
issue is occuring in our production site so any quick help will be very
helpful for us.

Thanks

Samanvay

Hello
Thanks for your request. Unfortunately, the issue is still pending for analysis. Once our developers analyze the issue, we will be able to provide you an estimate.
Sorry for inconvenience.
Best regards,

Hi

I hope you’re doing well. Are you able to anaylze the problem at your end? Did you get any solution for this? It would be great help; if you provide the solution as soon as possible.

Thanks
Samanvay.

Hi Samanvay,

Thank you for your patience. Unfortunately, this issue is still unresolved. Currently it is pending for analysis and is in the queue. You will surely be notified as soon as it is resolved. We apologize for your inconvenience.

Best Regards,

Hi

Are you able to anaylze the problem at your end ? Did you get any solution for this ? It would be great help, if you provide the solution as soon as possible.

or is it possible you can provide me any workaround fot this so can we will fixe this problem.

when we use 10.0.0.0 then we didn’t face this issue but when we use 10.5.0.0 then issue is coming.

Thanks
Samanvay.

Hi Samanvay,

Thanks for your inquiry. Unfortunately, there is still no news about WORDSNET-5499. I have asked our development team to take a look at your issue. I hope, the responsible developer will analyse the issue shortly and we will then be able to provide you more information on this. Sorry for inconvenience.

Best Regards,

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

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