• Home
  • Product-Life
  • PDF
  • Excel
  • Word
  • My Music Box
It's a long road...

HTML-to-RTF Pro DLL .Net

A standalone .Net class library for C#, VB.Net, J# and ColdFusuion developers. 

Learn More

C# Word – Insert Footnote into Word Document

7/10/2012

2 Comments

 
Word footnote is a string of text that appears at the end of a page which is commonly used by writers to cite other author’s publication in their document. A footnote is normally flagged by a superscripted number immediately following that portion of the text the note is in reference to.

Microsoft Word offers easy solution to insert footnote into Word document. However, by using C#, we can insert footnote into Word document even we don't install Microsoft on system.

Spire.Doc for .NET, a professional and powerful .NET Word component, which can easily help us insert footnote into Word document through C# code. Download Spire.Doc for .NET and make sure Spire.Doc for .NET and Visual Studio are correctly installed on system. Follow the simple instructions below to insert footnote into Word document.

Step 1 Create Project

Create a C# project in visual studio add Spire.Doc.dll as reference. The default setting of Spire.Doc.dll is placed under "C:\Program Files\e-iceblue\Spire.Doc\Bin”. Select assembly Spire.Doc.dll and click OK to add it to the project.

Step 2 Load Word Document

Use the following code to load Word document which we need insert footnote.

             Document document = new Document();
            document.LoadFromFile(@”E:\work\documents\Antarctic.docx”);
            Section section = document.Sections[0];
            Paragraph paragraph = section.Paragraphs[1];

Step 3 Insert Footnote into Word Document

Spire.Doc for .NET presents easy solution to insert footnote into Word document. Furthermore, it enables users to design font, color and size. The code below can help us insert footnote and design style.

            Footnote footnote=paragraph.AppendFootnote(FootnoteType.Footnote);
            TextRange text = footnote.TextBody.AddParagraph().AppendText(“If you want to get more information of Antarctic, please check from wiki.”);
            text.CharacterFormat.FontName = “Arial Narrow”;
            text.CharacterFormat.FontSize = 12;
            text.CharacterFormat.TextColor = Color.SlateGray;

Step 4 Save

After finish inserting footnotes, use the code below to save the settings. We can also rename the file here.

            document.SaveToFile(“FootNote.docx”, FileFormat.Docx);
            System.Diagnostics.Process.Start(“FootNote.docx”);

Effective Screenshots:
Picture
Spire.Doc is an MS Word component which enables user to perform a wide range of Word document processing tasks directly, such as generate, read, write and modify Word document for .NET. It supports C#, VB.NET, ASP.NET, ASP.NET and MVC. Click to learn more…

2 Comments
Ishana
12/19/2013 02:52:52 pm

I have added footnote into my word document in c# using Aspose.Words for .NET Library and its very easy to use this library. Try it:

http://www.aspose.com/.net/word-component.aspx

Reply
sadas
8/3/2017 09:33:27 am

Reply



Leave a Reply.

    Categories

    全部
    Add Header/Footer
    Add Watermark
    C# Add Images
    C# Word Hyperlinks
    C# Word Table
    C# Word Text Color
    Encrypt Word
    Extract Word Image
    Html To Image
    Html To Word
    Insert Page Break
    Insert Word Borders
    Merge Word Documents
    Set Word Properties
    Word Footnote
    Word To Epub
    Word To Html
    Word To Pdf

    RSS Feed

    Recommend Blog:


    Blu-ray/DVD Backup
    Office Tricks
    No.1 Software Pick

Powered by Create your own unique website with customizable templates.