Skip to content
Shiny.NET

Document Editor | References & Links

The Insert and References tabs. All of it is written the way Word writes it, so a document edited here opens in Word with working links, a table of contents Word can update, and real footnotes.

InsertHyperlink(target, text) (Ctrl+K) A w:hyperlink with an external relationship, or #bookmark for a place in the document. Drawn blue and underlined; RemoveHyperlink; CurrentHyperlink for editing
Following a link Ctrl/Cmd+click on Blazor; Open Link (Insert ▸ Links) on MAUI, where a touch screen has no Ctrl. External links raise LinkActivated / LinkClicked (default: open in the browser); bookmark links jump
InsertBookmark(name), GoToBookmark(name), Bookmarks Word’s naming rule enforced by IsValidBookmarkName
InsertDateTime(format), DateTimeFormats(now) Typed as text
InsertSymbol, CommonSymbols The symbol grid
InsertHorizontalLine An empty paragraph with a bottom border, which is what Word’s line is
InsertPageNumberField A PAGE field in the body
InsertBlankPage Two page breaks
InsertSectionBreak(NextPage | Continuous) A paragraph-level w:sectPr; a next-page break starts a new page in print layout

Headers, footers and page numbers in the header or footer are on Page Layout & Views.

InsertTableOfContents() builds one from Heading 1-3 before the caret’s paragraph, the way Word writes it: a TOC \o "1-3" \h \z \u field whose result is a line per heading, each a hyperlink to a hidden _Toc bookmark on the heading, with a right tab stop and a dotted leader before the page number. Page numbers come from a print pagination whatever the view is showing.

UpdateTableOfContents() (References ▸ Update Table) rebuilds it in place; Word regenerates it from the field too.

InsertFootnote(text) writes the reference and the note (footnotes.xml, created with Word’s separator notes). References are numbered by order of citation, not id, and renumber as notes are added. References ▸ Next Footnote steps through them.

In print layout each page’s notes are drawn at its foot under a short rule, and the paginator reserves the room for them; in reflow they follow the text under a rule. Endnotes are read and numbered but not drawn.

var c = editor.Controller!;
c.InsertHyperlink("https://shinylib.net", "Shiny");
c.InsertBookmark("Summary");
c.InsertHyperlink("#Summary", "see the summary");
c.InsertTableOfContents();
c.InsertFootnote("Source: annual report.");
c.UpdateTableOfContents();