In Aspose Words - control the repeat of FootNote

Hi There,


I’m adding footnote to word document generated using aspose.NET component. I’m using ReplaceHandler to search and add footnote, as explained in Inserting a footnote marker in the middle of a paragraph

public class ReplaceHandler : IReplacingCallback
{
ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
{
e.Replacement = e.Match.ToString();
Footnote footnote = new Footnote(e.MatchNode.Document, FootnoteType.Footnote);
e.MatchNode.ParentNode.InsertAfter(footnote, e.MatchNode);

footnote.Paragraphs.Add(new Paragraph(e.MatchNode.Document));
footnote.Font.Size = 10;
footnote.Font.Superscript = true;
footnote.FirstParagraph.Runs.Add(new Run(e.MatchNode.Document, “This is a test footnote.”));
return ReplaceAction.Replace;
}
}

I have 2 issues while adding the footnote.

1. The footnote “This is a test footnote” appears without any reference number.
2. There may be a chance that the text I try to replace may come multiple times. But I would like to number it with one reference number and one footnote.


Eg. I try to replace a text “HELP”, the document contains 5 “HELP” text in it. When I try to replace it creates 4 footnotes. I would like to limit the number of footnote to 1. All the 4 “HELP” should have reference to one footnote only.

I have added 2 documents.
Aspose-original.docx : Contains 4 multiple footnote for same text.

Aspose-expected.docx : Expected format with one footnote with reference to 4 HELP text in the document. [I manually edited it, the reference tooltip of footnote text not appearing in the 2nd, 3rd, 4th on HELP text]

I would like to see the footnote output as in the expected document. Please guide me how to achieve this.

Thank you.


Hi Senthil,

We are evaluating your requirement and will update you soon.

Best Regards,

Hi Ijaz,


Thank you for your reply. Please let me know if you have any update on the request sent earlier.

Thank you
Senthil

Hi Senthil,

In your Aspose-expected.docx file there is only one footnote which is referenced on first instance of HELP text. Remaining three notes placed on three HELP texts are just simple text with font set to superscript and are not footnotes. You can change place "1" text and set its Superscript property of Font class to true using Aspose.Words for .NET.

Can you please create a document using MS Word which has same numbers for multiple superscripts? MS Word does not support this feature as per my understanding.

Best Regards,

Hi Ijaz,


My apologies for the confusion. The sample I generated is the expected format of the document, where I used superscript text to refer the same footnote. When I created the sample document, I was not aware of the limitations of adding same footnote reference multiple times.

I came across an workaround to add multiple reference for a same footnote here:
Refer to the same footnote or endnote more than once - Microsoft Support

But this does not allow the footnote reference to have the all functionalities of actual footnote, like tooltip text of the footnote text and does not fall under footnote navigation when clicking the “Prev Footnote” or “Next Footnote” in the word app.

Thank you very much for looking into this and Sorry again for the confusion.

Regards
Senthil

Hi Senthil,

Thanks for the details. Yes, you are right; you can add a cross-reference field using Aspose.Words also but it will not act like a regular footnote.

Best Regards,