![]() ![]() 'Get the owner paragraph of the text rangeĭim paragraph As Paragraph = textRange.OwnerParagraph 'Get the found text as a single text rangeĭim textRange As TextRange = selection.GetAsOneRange() 'Initialize an instance of the Document classĭim document As Document = New Document()ĭim selection As TextSelection = document.FindString("Spire.Doc for. Private Shared Sub Main(ByVal args As String()) Set format for the footnote reference markį = "Calibri" į = 12 į = true į = Color.DarkGreen ĭocument.SaveToFile("InsertFootnote.docx", FileFormat.Docx2013) TextRange = ().AppendText("Developed by E-iceblue Co., LTD.") Insert the footnote reference mark after the text range Int index = (textRange) įootnote footnote = paragraph.AppendFootnote(FootnoteType.Footnote) Get the index of the text range in the paragraph Paragraph paragraph = textRange.OwnerParagraph ![]() Get the owner paragraph of the text range TextRange textRange = selection.GetAsOneRange() Get the found text as a single text range TextSelection selection = document.FindString("Spire.Doc for. ![]() Load a Word a specific text in the document ![]() Initialize an instance of the Document class Save the result document using Document.SaveToFile() method.Set formatting such as font name, font size and text color for the footnote text and reference mark.Set the footnote text using ().AppendText() method.Insert the footnote reference mark after the text range using () method.Add a footnote to the paragraph using Paragraph.AppendFootnote(FootnoteType.Footnote) method.Access the owner paragraph of the text range through TextRange.OwnerParagraph property and get the index of the text range in the paragraph using () method.Search for a specific text in the document using Document.FindString() method and get the found text as a single text range using TextSelection.GetAsOneRange() method.Load a Word document using Document.LoadFromFile() method.Initialize an instance of the Document class.To insert a footnote for a specific text, you need to search for the text and get the paragraph where the text is located, after that add a footnote to the paragraph, then insert the footnote reference mark after the found text and set the footnote text. Insert a Footnote in Word in C# and VB.NETĪ footnote consists of two parts - a footnote reference mark and the corresponding footnote text. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |