XDoc.Word
Features
Tech Specs
How-to C#
Pricing

C# Word Library
C# Word - Footnote & Endnote Processing in C#.NET


Provide Variety of C# Methods to Process Footnote & Endnote in Word Document





C#.NET Word document footnote & endnote processing Interface control (XDoc.Word).//More TODO is a tool which allow users to process footnote and endnote in an existing or new Word document.


Create Footnote & Endnote



The following demo code describe how to create a footnote and endnote in current paragraph.

String docFilePath = @"";
//Open the document
DOCXDocument document =DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a empty paragraph in body
IParagraph paragraph = doc.CreateParagraph();
//Before create footnote and endnote,run must created in paragraph
IRun run = paragraph.CreateARun();
run.CreateText("This is a run created for footnote and end note");
//Create a footenote for paragraph
IFootNote footnote = paragraph.CreateFootNote(0);
//More TODO:May create some block in footnote
//Create an endnote for paragraph
IEndNote endnote = paragraph.CreateEndnote(0);
//More TODO:May create some block in endnote

//Save the document
doc.Save(@"");


Create or Add Paragraph in Footnote & Endnote



This is a C# sample code which illustrates how to create paragraph in the footnote.

String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a paragraph for document
IParagraph paragraph = doc.CreateParagraph();
//Create a run for paragraph
IRun run = paragraph.CreateARun();
//Create text for run
run.CreateText("Paragrah for footnote and endnote");

//Just Show how to create a footnote and create paragraph for it.
//1.Create a footnote
IFootNote footnote = paragraph.CreateFootNote(0);
//2.Create a paragraph for footnote
IParagraph footnotePara = footnote.CreateParagraph();
//3.Create a Run for paragraph in footnote
IRun footnoteRun = footnotePara.CreateARun();
//4.Create text for run
footnoteRun.CreateText("Text created in footnote!");
//MORE TODO:
//
//
doc.Save(@"");


Create or Add Table in Footnote & Endnote



The following demo code shows how to create table in the footnote.

String docFilePath = @"";
//Open the document
DOCXDocument document = DOCXDocument.Open(docFilePath);
//Get the main document
IDocument doc = document.GetDocument();
//Create a paragraph for document
IParagraph paragraph = doc.CreateParagraph();
//Create a run for paragraph
IRun run = paragraph.CreateARun();
//Create text for run
run.CreateText("Paragrah for footnote and endnote");

//Just Show how to create a footnote and create table for it.
//1.Create a footnote
IFootNote footnote = paragraph.CreateFootNote(0);
//2.Create a table with 3 culumns and 3 rows for footnote
ITable footnoteTable = footnote.CreateTable(3, 3);
//MORE TODO:
//
//
doc.Save(@"");