WordHeaderScope
OfficeIMO.Word
Edits one WordHeader: its fluent methods and keywords, each returning this scope.
Inheritance
- object
- WordHeaderScope
Usage
Explore 19 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 14
- Method WordHeaderScope.Bookmark
- Method WordHeaderScope.Field
- Method WordHeaderScope.Fields
- Method WordHeaderScope.HorizontalLine
- Method WordHeaderScope.HyperLink
- Method WordHeaderScope.Image
- Method WordHeaderScope.List
- Method WordHeaderScope.PageNumber
- Method WordHeaderScope.Paragraph
- Method WordHeaderScope.Paragraphs
- Method WordHeaderScope.Shape
- Method WordHeaderScope.Table
- Method WordHeaderScope.TextBox
- Method WordHeaderScope.Watermark
Accepted by parameters 5
- Method WordDocumentScope.Header
- Method WordPageSetupScope.EvenPageHeader
- Method WordPageSetupScope.FirstPageHeader
- Method WordPageSetupScope.Header
- Method WordSectionScope.Header
Methods
public WordHeaderScope Bookmark(string bookmarkName, Action<WordBookmarkScope>? configure = null) #Adds a bookmark at the current location.
Parameters
- bookmarkName string
- Name of the bookmark.
- configure System.Action<OfficeIMO.Word.WordBookmarkScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Field(WordField item) #Adds an item to WordHeaderFooter.Fields: Gets the fields contained in the header or footer.
Parameters
- item OfficeIMO.Word.WordField
- The item.
public WordHeaderScope Field(WordFieldType wordFieldType, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, Action<WordFieldScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Field(WordFieldCode fieldCode, WordFieldFormat? wordFieldFormat = null, string? customFormat = null, bool advanced = false, Action<WordFieldScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Field(WordFieldBuilder builder, bool advanced = false, Action<WordFieldScope>? configure = null) #Inserts a field constructed with WordFieldBuilder.
Parameters
- builder OfficeIMO.Word.WordFieldBuilder
- Field builder instance.
- advanced bool = false
- Whether to use advanced formatting.
- configure System.Action<OfficeIMO.Word.WordFieldScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Fields(IEnumerable<WordField> items) #Adds items to WordHeaderFooter.Fields: Gets the fields contained in the header or footer.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordField>
- The items, in order.
public WordHeaderScope HorizontalLine(WordBorderStyle? lineType = null, OfficeColor? color = null, uint size = 12, uint space = 1, Action<WordParagraphScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordHeaderScope HyperLink(string text, Uri uri, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null
- Configures the new item through its scope.
public WordHeaderScope HyperLink(string text, string anchor, bool addStyle = false, string tooltip = "", bool history = true, Action<WordHyperLinkScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordHyperLinkScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Image(string path, OfficeLength? width = null, OfficeLength? height = null, WordImageOptions? options = null, Action<WordImageScope>? configure = null) #Adds an image to the header.
Parameters
- path string
- The value.
- width OfficeIMO.OfficeLength? = null
- The value.
- height OfficeIMO.OfficeLength? = null
- The value.
- options OfficeIMO.Word.WordImageOptions? = null
- The value.
- configure System.Action<OfficeIMO.Word.WordImageScope>? = null
- Configures the new item through its scope.
public WordHeaderScope List(WordListStyle style, Action<WordListScope>? configure = null) #Creates a list with the specified style.
Parameters
- style OfficeIMO.Word.WordListStyle
- List style to apply.
- configure System.Action<OfficeIMO.Word.WordListScope>? = null
- Configures the new item through its scope.
public WordHeaderScope PageNumber(WordPageNumberStyle wordPageNumberStyle, Action<WordPageNumberScope>? configure = null) #Adds a page number field to the header.
Parameters
- wordPageNumberStyle OfficeIMO.Word.WordPageNumberStyle
- The numbering style to apply.
- configure System.Action<OfficeIMO.Word.WordPageNumberScope>? = null
- Configures the new item through its scope.
public WordHeaderScope PageNumber(bool includeTotalPages = false, WordFieldFormat? format = null, string separator = " of ", Action<WordParagraphScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Paragraph(Action<WordParagraphScope> configure) #Adds a paragraph to the header and composes it.
Parameters
- configure System.Action<OfficeIMO.Word.WordParagraphScope>
- Adds text runs and formats the paragraph.
public WordHeaderScope Paragraph(WordParagraph item) #Adds an item to WordHeaderFooter.Paragraphs: Gets all paragraphs contained in the header or footer.
Parameters
- item OfficeIMO.Word.WordParagraph
- The item.
public WordHeaderScope Paragraph(string text, Action<WordParagraphScope>? configure = null) #Adds a new paragraph with the specified text to the header or footer.
Parameters
- text string
- Paragraph text.
- configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Paragraphs(IEnumerable<WordParagraph> items) #Adds items to WordHeaderFooter.Paragraphs: Gets all paragraphs contained in the header or footer.
Parameters
- items System.Collections.Generic.IEnumerable<OfficeIMO.Word.WordParagraph>
- The items, in order.
public WordHeaderScope Shape(WordShapeType shapeType, OfficeLength width, OfficeLength height, OfficeColor? fillColor = null, OfficeColor? strokeColor = null, OfficeLength? strokeWeight = null, double arcSize = 0.25, Action<WordShapeScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordShapeScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Table(Action<WordTableBuilder> compose) #Adds a table composed row by row to the header.
Parameters
- compose System.Action<OfficeIMO.Word.WordTableBuilder>
- Sets the columns, header row and rows.
public WordHeaderScope Table(int rows, int columns, WordTableStyle tableStyle = TableGrid, Action<WordTableScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordTableScope>? = null
- Configures the new item through its scope.
public WordHeaderScope TextBox(string text, WordImageTextWrapping wrapTextImage = Square, Action<WordTextBoxScope>? configure = null) #Adds a text box to the header.
Parameters
- text string
- Text contained in the text box.
- wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square
- Wrapping style.
- configure System.Action<OfficeIMO.Word.WordTextBoxScope>? = null
- Configures the new item through its scope.
public WordHeaderScope Watermark(WordWatermarkStyle watermarkStyle, string textOrFilePath, OfficeLength? horizontalOffset = null, OfficeLength? verticalOffset = null, double scale = 1, Action<WordWatermarkScope>? configure = null) #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.
- configure System.Action<OfficeIMO.Word.WordWatermarkScope>? = null
- Configures the new item through its scope.
Inherited Methods
Properties
public WordHeader Model { get; } #The WordHeader this scope edits, for plain C# inside a lambda.