Disable the “Link to Previous” option in each page of Word document

Hi,

I want to disable the “Link to Previous” option in each page from document using aspose.java.

Please help me to share the code logic/ method

Thanks in Advance !!

@Shyamu,

You can disable the ‘link to previous’ option in Word documents by using the following Aspose.Words for Java code. Hope, this helps.

com.aspose.words.Document document = new com.aspose.words.Document("E:\\Temp\\input.docx");

for(Section sec : document.getSections()){
    sec.getHeadersFooters().linkToPrevious(false);
}

document.save("E:\\Temp\\output.docx");

Thanks for your response !!

this code doesn’t support to disable the link to previous in header & footer section

Document destinatinDoc = new Document(“E:\Temp\input.docx”);
for (Section section : destinatinDoc.getSections()) {
section.getHeadersFooters().linkToPrevious(linktoPrev);
}

Also, I am facing another issue in header section as how to remove the “space after paragraph” option into header table section.

Please help me to try this issue.

@Shyamu,

To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document
  • Aspose.Words 19.9 generated output document showing the undesired behavior
  • Your expected document showing the correct output. You can create expected document by using MS Word 2019.
  • Please also provide a comparison screenshot highlighting the problematic areas in Aspose.Words 19.9 generated output file with respect to your expected document and attach it here for our reference.
  • Please also create a standalone simple Java application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words JAR files in it to reduce the file size.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.