API Reference

Class

WordHeader

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents a single header instance within a section.

Inheritance

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters

Methods

public WordImage AddImageVml(String filePathImage, Nullable<Double> width = null, Nullable<Double> height = null) #
Returns: WordImage

Adds a VML image to the header.

Parameters

filePathImage System.String requiredposition: 0
width System.Nullable{System.Double} = null optionalposition: 1
height System.Nullable{System.Double} = null optionalposition: 2
public WordPageNumber AddPageNumber(WordPageNumberStyle wordPageNumberStyle) #
Returns: WordPageNumber

Adds a page number field to the header.

Parameters

wordPageNumberStyle OfficeIMO.Word.WordPageNumberStyle requiredposition: 0
The numbering style to apply.

Returns

The created WordPageNumber.

AddShape 2 overloads
public WordShape AddShape(WordShapeType shapeType, Double widthPt, Double heightPt, String fillColor = "#FFFFFF", String strokeColor = "#000000", Double strokeWeightPt = 1, Double arcSize = 0.25) #
Returns: WordShape

Adds a VML shape to the header.

Parameters

shapeType OfficeIMO.Word.WordShapeType requiredposition: 0
Type of shape to create.
widthPt System.Double requiredposition: 1
Width in points or line end X.
heightPt System.Double requiredposition: 2
Height in points or line end Y.
fillColor System.String = "#FFFFFF" optionalposition: 3
Fill color in hex format.
strokeColor System.String = "#000000" optionalposition: 4
Stroke color in hex format.
strokeWeightPt System.Double = 1 optionalposition: 5
Stroke weight in points.
arcSize System.Double = 0.25 optionalposition: 6
Corner roundness fraction for rounded rectangles.
public WordShape AddShape(WordShapeType shapeType, Double widthPt, Double heightPt, OfficeColor fillColor, OfficeColor strokeColor, Double strokeWeightPt = 1, Double arcSize = 0.25) #
Returns: WordShape

Adds a VML shape to the header using OfficeColor values.

Parameters

arg1 OfficeIMO.Word.WordShapeType requiredposition: 0
arg2 System.Double requiredposition: 1
arg3 System.Double requiredposition: 2
arg4 OfficeIMO.Drawing.OfficeColor requiredposition: 3
arg5 OfficeIMO.Drawing.OfficeColor requiredposition: 4
arg6 System.Double = 1 optionalposition: 5
arg7 System.Double = 0.25 optionalposition: 6
public WordShape AddShapeDrawing(WordShapeType shapeType, Double widthPt, Double heightPt) #
Returns: WordShape

Adds a DrawingML shape to the header.

Parameters

shapeType OfficeIMO.Word.WordShapeType requiredposition: 0
Type of shape to create.
widthPt System.Double requiredposition: 1
Width in points.
heightPt System.Double requiredposition: 2
Height in points.
public WordTextBox AddTextBox(String text, WordImageTextWrapping wrapTextImage = Square) #
Returns: WordTextBox

Adds a text box to the header.

Parameters

text System.String requiredposition: 0
Text contained in the text box.
wrapTextImage OfficeIMO.Word.WordImageTextWrapping = Square optionalposition: 1
Wrapping style.

Returns

The created WordTextBox.

public WordTextBox AddTextBoxVml(String text) #
Returns: WordTextBox

Adds a VML text box to the header.

Parameters

text System.String requiredposition: 0
public WordWatermark AddWatermark(WordWatermarkStyle watermarkStyle, String textOrFilePath, Nullable<Double> horizontalOffset = null, Nullable<Double> verticalOffset = null, Double scale = 1) #
Returns: WordWatermark

Adds a watermark to the header.

Parameters

watermarkStyle OfficeIMO.Word.WordWatermarkStyle requiredposition: 0
Watermark style.
textOrFilePath System.String requiredposition: 1
Text or image path for the watermark.
horizontalOffset System.Nullable{System.Double} = null optionalposition: 2
Horizontal offset in points.
verticalOffset System.Nullable{System.Double} = null optionalposition: 3
Vertical offset in points.
scale System.Double = 1 optionalposition: 4
Scale factor for width and height.

Returns

The created WordWatermark.

public static Void RemoveHeaders(WordDocument document, params WordHeaderFooterType[] types) #
Returns: Void

Removes headers from the specified WordDocument. When no types are provided all headers are removed.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
Document to operate on.
types OfficeIMO.Word.WordHeaderFooterType[] requiredposition: 1
Header types to remove.