// Get the XFootnote interface to the first footnote inserted ('Numbers')
XFootnote xNumbers = ( XFootnote ) UnoRuntime.queryInterface (
XFootnote.class, xFootnotes.getByIndex( 0 ) );
// Get the XSimpleText interface to the Footnote
XSimpleText xSimple = (XSimpleText ) UnoRuntime.queryInterface (
XSimpleText.class, xNumbers );
// Create a text cursor for the foot note text
XTextRange xRange = (XTextRange ) UnoRuntime.queryInterface (
XTextRange.class, xSimple.createTextCursor() );
// And insert the actual text of the footnote.
xSimple.insertString (
xRange, " The numbers were generated by using java.util.Random", false );
}
catch (Exception e)
{
e.printStackTrace();