Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordHeaderScope

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
22fb5b2be3d2 with working tree changes
Modifiers
sealed

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.

Accepted by parameters 5

Methods

public WordHeaderScope Bookmark(string bookmarkName, Action<WordBookmarkScope>? configure = null) #

Adds a bookmark at the current location.

Parameters

bookmarkName string required
Name of the bookmark.
configure System.Action<OfficeIMO.Word.WordBookmarkScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
Field 4 overloads
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 required
The item.

Returns

WordHeaderScope The same scope.
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 required
Type of field to insert.
wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null optional
Optional field format.
customFormat string? = null optional
Custom format string for date or time fields.
advanced bool = false optional
Whether to use advanced formatting.
configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same 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 required
Field code instance.
wordFieldFormat OfficeIMO.Word.WordFieldFormat? = null optional
Optional field format.
customFormat string? = null optional
Custom format string for date or time fields.
advanced bool = false optional
Whether to use advanced formatting.
configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
public WordHeaderScope Field(WordFieldBuilder builder, bool advanced = false, Action<WordFieldScope>? configure = null) #

Inserts a field constructed with WordFieldBuilder.

Parameters

builder OfficeIMO.Word.WordFieldBuilder required
Field builder instance.
advanced bool = false optional
Whether to use advanced formatting.
configure System.Action<OfficeIMO.Word.WordFieldScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same 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> required
The items, in order.

Returns

WordHeaderScope The same scope.
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 optional
Border style of the line.
color OfficeIMO.OfficeColor? = null optional
Color of the line.
size uint = 12 optional
Thickness of the line.
space uint = 1 optional
Spacing above and below the line.
configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
HyperLink 2 overloads
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 required
The value.
width OfficeIMO.OfficeLength? = null optional
The value.
height OfficeIMO.OfficeLength? = null optional
The value.
options OfficeIMO.Word.WordImageOptions? = null optional
The value.
configure System.Action<OfficeIMO.Word.WordImageScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
public WordHeaderScope List(WordListStyle style, Action<WordListScope>? configure = null) #

Creates a list with the specified style.

Parameters

style OfficeIMO.Word.WordListStyle required
List style to apply.
configure System.Action<OfficeIMO.Word.WordListScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
PageNumber 2 overloads
public WordHeaderScope PageNumber(WordPageNumberStyle wordPageNumberStyle, Action<WordPageNumberScope>? configure = null) #

Adds a page number field to the header.

Parameters

wordPageNumberStyle OfficeIMO.Word.WordPageNumberStyle required
The numbering style to apply.
configure System.Action<OfficeIMO.Word.WordPageNumberScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same 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 optional
Include total pages in the display.
format OfficeIMO.Word.WordFieldFormat? = null optional
Optional number format.
separator string = " of " optional
Separator used when total pages are included.
configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
Paragraph 3 overloads
public WordHeaderScope Paragraph(Action<WordParagraphScope> configure) #

Adds a paragraph to the header and composes it.

Parameters

configure System.Action<OfficeIMO.Word.WordParagraphScope> required
Adds text runs and formats the paragraph.

Returns

WordHeaderScope The same scope.
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 required
The item.

Returns

WordHeaderScope The same scope.
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 required
Paragraph text.
configure System.Action<OfficeIMO.Word.WordParagraphScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same 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> required
The items, in order.

Returns

WordHeaderScope The same scope.
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 required
Type of shape to create.
width OfficeIMO.OfficeLength required
Width or line end X.
height OfficeIMO.OfficeLength required
Height or line end Y.
fillColor OfficeIMO.OfficeColor? = null optional
Fill color; white when omitted.
strokeColor OfficeIMO.OfficeColor? = null optional
Stroke color; black when omitted.
strokeWeight OfficeIMO.OfficeLength? = null optional
Stroke thickness; one point when omitted.
arcSize double = 0.25 optional
Corner roundness fraction for rounded rectangles.
configure System.Action<OfficeIMO.Word.WordShapeScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
Table 2 overloads
public WordHeaderScope Table(Action<WordTableBuilder> compose) #

Adds a table composed row by row to the header.

Parameters

compose System.Action<OfficeIMO.Word.WordTableBuilder> required
Sets the columns, header row and rows.

Returns

WordHeaderScope The same scope.
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 required
Number of rows.
columns int required
Number of columns.
tableStyle OfficeIMO.Word.WordTableStyle = TableGrid optional
Table style to apply.
configure System.Action<OfficeIMO.Word.WordTableScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.
public WordHeaderScope TextBox(string text, WordImageTextWrapping wrapTextImage = Square, Action<WordTextBoxScope>? configure = null) #

Adds a text box to the header.

Parameters

text string required
Text contained in the text box.
wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square optional
Wrapping style.
configure System.Action<OfficeIMO.Word.WordTextBoxScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same 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 required
Watermark style.
textOrFilePath string required
Text or image path for the watermark.
horizontalOffset OfficeIMO.OfficeLength? = null optional
Optional signed horizontal offset.
verticalOffset OfficeIMO.OfficeLength? = null optional
Optional signed vertical offset.
scale double = 1 optional
Scale factor for width and height.
configure System.Action<OfficeIMO.Word.WordWatermarkScope>? = null optional
Configures the new item through its scope.

Returns

WordHeaderScope The same scope.

Properties

public WordHeader Model { get; } #

The WordHeader this scope edits, for plain C# inside a lambda.