Free Support Forum -

Having problems getting Footnote Number from MS Word document

I am using Aspose.Words for Java version 4.0.3. I am trying to get the footnote number format and the footnote reference identifer from a ms word docx document. In the document down below I am trying to get the 1,2, 3.

I thought that I could use the FootnoteOptions class to get these Identifers, but I'm not user how to use that class, and I have not found any code examples.

This is an inserted footnote.[1] On the other hand, it has been observed that our attempts at prevention by punishment may enjoy an unmeasurable degree of success, in that without punishment for purposes of prevention the rate of recidivism might be much higher. This is an inserted footnote.[2] This assumption is not capable of precise proof, nor is the assertion that in some instances punishment for prevention will fill the prisoner with feelings of hatred and desire for revenge against society and thus influence future criminal conduct. This is an inserted footnote.[3]

[1] It defaults to style Footnote Text, which is the MS Word default

[2] Modified to our paragraph style FN Numbered Paragraph. They are also likely to reject utilitarian approaches to punishment because of the view that punishment may not be inflicted upon a person in order to benefit the collective interests of others.

Continuation of above footnote. Some contend that when one commits a crime, it is important that he receive commensurate punishment in order to restore the peace of mind and repress the criminal tendencies of others.

[3] Modified to our paragraph style FN Text Block.

Continuation of above footnote, but with Word's Indent applied once. For this reason, even some critics of the retribution theory acknowledge that it must occupy a "minor position" in the contemporary scheme.


Thanks for your request. The problem is that footnote numbers are not stored in Microsoft Word documents. Footnote numbers must be calculated by the program that needs them. The same can be said about numbered paragraphs.

Aspose.Words calculates footnote numbers (and list numbers) when it needs them. E.g. when exporting or rendering. But at the moment there is no way to get these numbers programmatically from the model. We do have this feature planned (to be able to return footnote numbers), hopefully some time in 2011.

In the meantime you can try calculating the number of the footntoe yourself. You can keep a counter for footnotes. You can also access document and section properties that specify footnote starting number.

The only problem you will have is that footnote number can be one of several number styles (e.g. Arabic, Uppercase Roman, Lowercase Roman etc). But if you limit yourself to just Arabic numbers it will be easy to do.

Best regards,