Free Support Forum -

Deepclone section ( not the last section) using aspose word

Is there is a way to deepclone the document section not the last section. For example. I want to clone the section 1.2.1 for each list value using java code.How to get the section index for this to iterate. Please advise its urgent.

  1. section1
    1.1 section2
    1.2 section3
    1.2.1 want this section to deepclone for the list of data.
    1.3 section4
    1.3.1 .deepclone this section is easy as we can take the last section count and deepclone


Thanks for your inquiry. We will appreciate it if you please confirm that you are interested in Aspose.Words for Java(on-premise API) or Aspose.Words Cloud SDK for Java(Rest API). As currently deepclone method is supported in Aspose.Words for Java(on-premise API). It will help us to answer your query exactly.

Thanks for the reply. Is for Aspose on-primise API. for example
int c3 = 1;
while (c3 < total1) {
int lastSectionIdx = doc.getSections().getCount()-1;
com.aspose.words.Section newSection = doc.getSections().get(lastSectionIdx).deepClone();
the above code will get always the last section of the list (1.3 +1.3.1 section) and deepclone. but I want it should deep clone list (1.2+ 1.2.1) section and (1.2.1) section as per requirement. But it always take last section and deep clone which is not my requirement.
Hope this gives a better idea. Plz let me know if you need more details to give solution.


This topic has been moved to the related forum: