---
title: "Working with Footnote and Endnote"
---

Aspose.Words also provides some classes, methods and properties for working with footnotes and endnotes.

## Insert Endnote and Set Numbering Options

If you want to insert a footnote or endnote in a Word document, please use the [InsertFootnote](https://reference.aspose.com/words/cpp/aspose.words/documentbuilder/insertfootnote/) method. This method inserts a footnote or endnote into the document.

[EndnoteOptions](https://reference.aspose.com/words/cpp/aspose.words.notes/endnoteoptions/) and [FootnoteOptions](https://reference.aspose.com/words/cpp/aspose.words.notes/footnoteoptions/) classes represent numbering options for footnote and endnote.

The following code example shows how to insert endnote into the document and set its numbering options:

{{< gist "aspose-words-gists" "d55d8631947d283b1f0da99afa06c492" "cpp-Programming-Documents-Document-WorkingWithFootnote-SetEndnoteOptions.cpp" >}}

## Set Number of Footnote Layout Columns

You can set the number of footnote layout columns using the [Columns](https://reference.aspose.com/words/cpp/aspose.words.notes/footnoteoptions/get_columns/) property. If this property has a value of 0, the footnotes area is formatted with a number of columns based on the number of columns on the displayed page.

The following code example shows how to set the number of columns for footnote layout:

{{< gist "aspose-words-gists" "d55d8631947d283b1f0da99afa06c492" "cpp-Programming-Documents-Document-WorkingWithFootnote-SetFootNoteColumns.cpp" >}}

## Set the Position of Footnote and EndNote

The footnote position can be at the bottom of each page or beneath the text on each page. The endnote position can be at the end of the section or at the end of the document.

The following code example shows how to set the position of footnote and endnote:

{{< gist "aspose-words-gists" "d55d8631947d283b1f0da99afa06c492" "cpp-Programming-Documents-Document-WorkingWithFootnote-SetFootnoteAndEndNotePosition.cpp" >}}

------

## FAQ

1. **Q:** How can I change the numbering format of footnotes or endnotes?
   **A:** Use the `FootnoteOptions::set_NumberStyle` or `EndnoteOptions::set_NumberStyle` property on the document’s `FootnoteOptions`/`EndnoteOptions` object. For example:

   ```cpp
   System::SharedPtr<Aspose::Words::Notes::FootnoteOptions> footnoteOpts = doc->get_FootnoteOptions();
   footnoteOpts->set_NumberStyle(Aspose::Words::Notes::NumberStyle::UpperRoman);
   ```

2. **Q:** How can I retrieve all footnotes or endnotes from a document?
   **A:** The document provides `get_Footnotes()` and `get_Endnotes()` collections. Iterate over them to access each note’s properties, such as its text:

   ```cpp
   for (auto footnote : System::IterateOver(doc->get_Footnotes()))
   {
       System::String text = footnote->GetText();
       // Process text...
   }
   ```

3. **Q:** How can I detect whether a document contains any footnotes or endnotes?
   **A:** Check the `Count` property of the respective collections. If the count is greater than zero, the document contains those notes:

   ```cpp
   bool hasFootnotes = doc->get_Footnotes()->get_Count() > 0;
   bool hasEndnotes  = doc->get_Endnotes()->get_Count() > 0;
   ```

4. **Q:** Can I convert an existing endnote to a footnote (or vice‑versa) after it has been inserted?
   **A:** Aspose.Words does not provide a direct conversion method. Remove the original note using `Remove()` and re‑insert a new note of the desired type with `DocumentBuilder::InsertFootnote`, specifying `NoteType::Footnote` or `NoteType::Endnote`.

   ```cpp
   // Remove existing endnote
   endnote->Remove();

   // Insert a footnote at the same location
   System::SharedPtr<Aspose::Words::DocumentBuilder> builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
   builder->MoveTo(endnote->get_Paragraph());
   builder->InsertFootnote(Aspose::Words::Notes::NoteType::Footnote, Aspose::Words::Notes::FootnoteType::Normal, System::String(u"New footnote text"));
   ```