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:
Master Document
Append word file(word_Doc.docx)
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");
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.
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,
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,
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.
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.
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,
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.
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,
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.
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,
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.
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.
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 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.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.