WordHeaderFooter
OfficeIMO.Word
Represents the shared functionality for headers and footers and exposes their content through various collections.
Inheritance
- object
- WordHeaderFooter
Derived Types
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Accepted by parameters 2
- Constructor WordList.WordList
- Constructor WordTextBox.WordTextBox
Constructors
public WordHeaderFooter() #Methods
public WordBookmark AddBookmark(string bookmarkName) #Adds a bookmark at the current location.
Parameters
- bookmarkName string
- Name of the bookmark.
public WordField AddField(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false) #Adds a field to the header or footer.
Parameters
- wordFieldType OfficeIMO.Word.WordFieldType
- Type of field to insert.
- wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null
- Optional field format.
- customFormat string? = null
- Custom format string for date or time fields.
- advanced bool = false
- Whether to use advanced formatting.
public WordField AddField(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false) #Inserts a field represented by a WordFieldCode.
Parameters
- fieldCode OfficeIMO.Word.WordFieldCode
- Field code instance.
- wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null
- Optional field format.
- customFormat string? = null
- Custom format string for date or time fields.
- advanced bool = false
- Whether to use advanced formatting.
public WordField AddField(WordFieldBuilder builder, bool advanced = false) #Inserts a field constructed with WordFieldBuilder.
Parameters
- builder OfficeIMO.Word.WordFieldBuilder
- Field builder instance.
- advanced bool = false
- Whether to use advanced formatting.
public WordParagraph AddHorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1) #Adds a horizontal line to the header or footer.
Parameters
- lineType OfficeIMO.Word.WordBorderStyle? = null
- Border style of the line.
- color OfficeIMO.OfficeColor? = null
- Color of the line.
- size uint = 12
- Thickness of the line.
- space uint = 1
- Spacing above and below the line.
public WordHyperLink AddHyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true) #Adds a hyperlink pointing to an external URI.
Parameters
- text string
- Display text for the hyperlink.
- uri System.Uri
- Destination URI.
- addStyle bool = false
- Whether to apply hyperlink style.
- tooltip string = ""
- Tooltip text for the link.
- history bool = true
- Whether to mark the link as visited.
public WordHyperLink AddHyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true) #Adds an internal hyperlink to a bookmark within the document.
Parameters
- text string
- Display text for the hyperlink.
- anchor string
- Bookmark to link to.
- addStyle bool = false
- Whether to apply hyperlink style.
- tooltip string = ""
- Tooltip text for the link.
- history bool = true
- Whether to mark the link as visited.
public WordList AddList(WordListStyle style) #Creates a list with the specified style.
Parameters
- style OfficeIMO.Word.WordListStyle
- List style to apply.
public WordParagraph AddPageNumber(bool includeTotalPages = false, WordFieldFormat? format = null, string separator = " of ") #Inserts a page number field.
Parameters
- includeTotalPages bool = false
- Include total pages in the display.
- format OfficeIMO.Word.WordFieldFormat? = null
- Optional number format.
- separator string = " of "
- Separator used when total pages are included.
public WordParagraph AddParagraph(string text) #Adds a new paragraph with the specified text to the header or footer.
Parameters
- text string
- Paragraph text.
public WordParagraph AddParagraph(bool newRun = false) #Creates an empty paragraph and appends it to the header or footer.
Parameters
- newRun bool = false
- Specifies whether a new run should be started.
public WordTable AddTable(int rows, int columns, WordTableStyle tableStyle = TableGrid) #Creates a table and appends it to the header or footer.
Parameters
- rows int
- Number of rows.
- columns int
- Number of columns.
- tableStyle OfficeIMO.Word.WordTableStyle = TableGrid
- Table style to apply.
Inherited Methods
Properties
public List<WordParagraph> Paragraphs { get; } #Gets all paragraphs contained in the header or footer.
public List<WordElement> Elements { get; } #Gets the direct child elements contained in the header or footer in document order.
public List<WordTable> Tables { get; } #Gets all tables contained in the header or footer.
public List<WordTextBox> TextBoxes { get; } #Gets all text boxes contained in the header or footer.
public List<WordParagraph> ParagraphsPageBreaks { get; } #Gets paragraphs that contain a page break.
public List<WordParagraph> ParagraphsHyperLinks { get; } #Gets paragraphs that contain a hyperlink.
public List<WordParagraph> ParagraphsFields { get; } #Gets paragraphs that contain a field.
public List<WordParagraph> ParagraphsBookmarks { get; } #Gets paragraphs that contain a bookmark.
public List<WordParagraph> ParagraphsEquations { get; } #Gets paragraphs that contain an equation.
public List<WordParagraph> ParagraphsStructuredDocumentTags { get; } #Provides a list of paragraphs that contain Structured Document Tags
public List<WordParagraph> ParagraphsCheckBoxes { get; } #Gets paragraphs that contain a check box.
public List<WordParagraph> ParagraphsDatePickers { get; } #Gets paragraphs that contain a date picker control.
public List<WordParagraph> ParagraphsDropDownLists { get; } #Gets paragraphs that contain a dropdown list control.
public List<WordParagraph> ParagraphsRepeatingSections { get; } #Gets paragraphs that contain a repeating section control.
public List<WordParagraph> ParagraphsImages { get; } #Provides a list of paragraphs that contain Image
public List<WordParagraph> ParagraphsSmartArts { get; } #Provides a list of paragraphs that contain SmartArt diagrams.
public List<WordBreak> PageBreaks { get; } #Gets the page breaks contained in the header or footer.
public List<WordImage> Images { get; } #Exposes Images in their Image form for easy access (saving, modifying)
public List<WordSmartArt> SmartArts { get; } #Gets the SmartArt diagrams contained in the header or footer.
public List<WordBookmark> Bookmarks { get; } #Gets the bookmarks contained in the header or footer.
public List<WordField> Fields { get; } #Gets the fields contained in the header or footer.
public List<WordHyperLink> HyperLinks { get; } #Gets the hyperlinks contained in the header or footer.
public List<WordEquation> Equations { get; } #Gets the equations contained in the header or footer.
public List<WordStructuredDocumentTag> StructuredDocumentTags { get; } #Gets the structured document tags contained in the header or footer.
public List<WordCheckBox> CheckBoxes { get; } #Gets the check boxes contained in the header or footer.
public List<WordDatePicker> DatePickers { get; } #Gets the date pickers contained in the header or footer.
public List<WordDropDownList> DropDownLists { get; } #Gets the dropdown lists contained in the header or footer.
public List<WordRepeatingSection> RepeatingSections { get; } #Gets the repeating sections contained in the header or footer.
public List<WordWatermark> Watermarks { get; } #Gets the watermarks contained in the header or footer.