WordHeader
OfficeIMO.Word
Represents a single header instance within a section.
Inheritance
- WordHeaderFooter
- WordHeader
Usage
Explore 7 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.
Returned or exposed by 5
- Method WordDocument.GetHeaderForSection
- Method WordPageSetup.GetHeader
- Property WordPageSetup.EvenPageHeader
- Property WordPageSetup.FirstPageHeader
- Property WordPageSetup.Header
Accepted by parameters 2
- Constructor WordPageNumber.WordPageNumber
- Constructor WordWatermark.WordWatermark
Methods
public WordImage AddImage(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null) #Adds an image to the header.
Parameters
- path string
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- options OfficeIMO.Word.WordImageOptions? = null
Returns
WordImagepublic WordPageNumber AddPageNumber(WordPageNumberStyle wordPageNumberStyle) #Adds a page number field to the header.
Parameters
- wordPageNumberStyle OfficeIMO.Word.WordPageNumberStyle
- The numbering style to apply.
public WordShape AddShape(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeColor? fillColor = null, OfficeColor? strokeColor = null, OfficeLength? strokeWeight = null, double arcSize = 0.25) #Adds a VML shape to the header.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- width OfficeIMO.OfficeLength
- Width or line end X.
- height OfficeIMO.OfficeLength
- Height or line end Y.
- fillColor OfficeIMO.OfficeColor? = null
- Fill color; white when omitted.
- strokeColor OfficeIMO.OfficeColor? = null
- Stroke color; black when omitted.
- strokeWeight OfficeIMO.OfficeLength? = null
- Stroke thickness; one point when omitted.
- arcSize double = 0.25
- Corner roundness fraction for rounded rectangles.
Returns
WordShapepublic WordShape AddShapeDrawing(WordShapeType shapeType, OfficeLength width, OfficeLength height) #Adds a DrawingML shape to the header.
Parameters
- shapeType OfficeIMO.Word.WordShapeType
- Type of shape to create.
- width OfficeIMO.OfficeLength
- Width.
- height OfficeIMO.OfficeLength
- Height.
Returns
WordShapepublic WordTextBox AddTextBox(string text, WordImageTextWrapping wrapTextImage = Square) #Adds a text box to the header.
Parameters
- text string
- Text contained in the text box.
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square
- Wrapping style.
public WordTextBox AddTextBoxVml(string text) #Adds a VML text box to the header.
Parameters
- text string
Returns
WordTextBoxpublic WordWatermark AddWatermark(WordWatermarkStyle watermarkStyle, string textOrFilePath, OfficeLength? horizontalOffset = null, OfficeLength? verticalOffset = null, double scale = 1) #Adds a watermark to the header.
Parameters
- watermarkStyle OfficeIMO.Word.WordWatermarkStyle
- Watermark style.
- textOrFilePath string
- Text or image path for the watermark.
- horizontalOffset OfficeIMO.OfficeLength? = null
- Optional signed horizontal offset.
- verticalOffset OfficeIMO.OfficeLength? = null
- Optional signed vertical offset.
- scale double = 1
- Scale factor for width and height.
Inherited Methods
public WordBookmark AddBookmark(string bookmarkName) #Parameters
- bookmarkName string
Returns
WordBookmarkpublic WordField AddField(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false) #Parameters
- wordFieldType WordFieldType
- wordFieldFormat WordFieldFormat? = null
- customFormat string? = null
- advanced bool = false
Returns
WordFieldpublic WordField AddField(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false) #Parameters
- fieldCode WordFieldCode
- wordFieldFormat WordFieldFormat? = null
- customFormat string? = null
- advanced bool = false
Returns
WordFieldpublic WordField AddField(WordFieldBuilder builder, bool advanced = false) #Parameters
- builder WordFieldBuilder
- advanced bool = false
Returns
WordFieldpublic WordParagraph AddHorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1) #Parameters
- lineType WordBorderStyle? = null
- color OfficeColor? = null
- size uint = 12
- space uint = 1
Returns
WordParagraphpublic WordHyperLink AddHyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true) #Parameters
- text string
- uri Uri
- addStyle bool = false
- tooltip string = ""
- history bool = true
Returns
WordHyperLinkpublic WordHyperLink AddHyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true) #Parameters
- text string
- anchor string
- addStyle bool = false
- tooltip string = ""
- history bool = true
Returns
WordHyperLinkpublic WordList AddList(WordListStyle style) #Parameters
- style WordListStyle
Returns
WordListpublic WordParagraph AddPageNumber(bool includeTotalPages = false, WordFieldFormat? format = null, string separator = " of ") #Parameters
- includeTotalPages bool = false
- format WordFieldFormat? = null
- separator string = " of "
Returns
WordParagraphpublic WordParagraph AddParagraph(string text) #Parameters
- text string
Returns
WordParagraphpublic WordParagraph AddParagraph(bool newRun = false) #Parameters
- newRun bool = false
Returns
WordParagraphpublic WordTable AddTable(int rows, int columns, WordTableStyle tableStyle = TableGrid) #Parameters
- rows int
- columns int
- tableStyle WordTableStyle = TableGrid
Returns
WordTableInherited Properties
public List<WordParagraph> Paragraphs { get; } #public List<WordElement> Elements { get; } #public List<WordTable> Tables { get; } #public List<WordTextBox> TextBoxes { get; } #public List<WordParagraph> ParagraphsPageBreaks { get; } #public List<WordParagraph> ParagraphsHyperLinks { get; } #public List<WordParagraph> ParagraphsFields { get; } #public List<WordParagraph> ParagraphsBookmarks { get; } #public List<WordParagraph> ParagraphsEquations { get; } #public List<WordParagraph> ParagraphsStructuredDocumentTags { get; } #public List<WordParagraph> ParagraphsCheckBoxes { get; } #public List<WordParagraph> ParagraphsDatePickers { get; } #public List<WordParagraph> ParagraphsDropDownLists { get; } #public List<WordParagraph> ParagraphsRepeatingSections { get; } #public List<WordParagraph> ParagraphsImages { get; } #public List<WordParagraph> ParagraphsSmartArts { get; } #public List<WordBreak> PageBreaks { get; } #public List<WordImage> Images { get; } #public List<WordSmartArt> SmartArts { get; } #public List<WordBookmark> Bookmarks { get; } #public List<WordField> Fields { get; } #public List<WordHyperLink> HyperLinks { get; } #public List<WordEquation> Equations { get; } #public List<WordStructuredDocumentTag> StructuredDocumentTags { get; } #public List<WordCheckBox> CheckBoxes { get; } #public List<WordDatePicker> DatePickers { get; } #public List<WordDropDownList> DropDownLists { get; } #public List<WordRepeatingSection> RepeatingSections { get; } #public List<WordWatermark> Watermarks { get; } #