Imports Docs.Word



Public Class Textruns_Footnotes
	Friend Shared Function Main1() As Document
		'	Open the document with given name and get first paragraph
		Dim Doc As Document = Document.ReadDoc(Form1.SourceFolder + "Textruns - Footnotes.doc")
		Dim Par As Paragraph = DirectCast(Doc.Sections(0).Nodes(0), Paragraph)

		'	Set up footnote and endnote styles
		Doc.Sections(0).Style.FootnoteStyle.Positioning = FootnotesPlacement.BeneathText
		Doc.Sections(0).Style.EndnoteStyle.Positioning = EndnotesPlacement.EndOfSection

		'	Make footnote and endnote
        Par.GetTextrun(31, 27).AddFootnote("Footnote 1")
        Par.GetTextrun(194, 10).AddEndnote("Endnote 1")

		Return Doc
	End Function
End Class
