Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

WordPaperStyle

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word
Source revision 799b2bd0d000 with working tree changes
Modifiers sealed

Configurable typography and quiet table styling for printed reports, independent of a product theme.

Inheritance

  • Object
  • WordPaperStyle

Constructors

public WordPaperStyle() #

Methods

public WordParagraph AddCallout(WordDocument document, String title, String body, String tone, String tint) #
Returns: WordParagraph

Adds a shaded callout with a 3 pt left rule. The caller supplies semantic theme colors.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
title System.String requiredposition: 1
body System.String requiredposition: 2
tone System.String requiredposition: 3
tint System.String requiredposition: 4
public WordTable AddCountTable(WordDocument document, IEnumerable<KeyValuePair<String, String>> rows, String keyHeader = "Metric", String valueHeader = "Count") #
Returns: WordTable

Adds a content-sized count table. Unknown values may be supplied as text alongside numeric counts.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
rows System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> requiredposition: 1
keyHeader System.String = "Metric" optionalposition: 2
valueHeader System.String = "Count" optionalposition: 3
public Void AddCover(WordDocument document, String eyebrow, String title, String subtitle) #
Returns: Void

Adds a cover's eyebrow, title and subtitle using the paper type scale.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
eyebrow System.String requiredposition: 1
title System.String requiredposition: 2
subtitle System.String requiredposition: 3
public WordTable AddKeyValueTable(WordDocument document, IEnumerable<KeyValuePair<String, String>> rows, String keyHeader = "Field", String valueHeader = "Value", Boolean allowRowSplit = false, Boolean hasHeader = true) #
Returns: WordTable

Adds a two-column evidence table using the paper rules and preserving multiline values.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
The destination document.
rows System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> requiredposition: 1
Labels and their evidence text, in display order.
keyHeader System.String = "Field" optionalposition: 2
First column label.
valueHeader System.String = "Value" optionalposition: 3
Second column label.
allowRowSplit System.Boolean = false optionalposition: 4
Whether long evidence may continue on another page.
hasHeader System.Boolean = true optionalposition: 5
Whether to include a header row; false is useful for cover and definition tables.

Returns

The styled evidence table.

public WordTable AddMetrics(WordDocument document, params WordPaperMetric[] metrics) #
Returns: WordTable

Adds a row of metric cards, each with a large value, label and optional qualifier.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
metrics OfficeIMO.Word.WordPaperMetric[] requiredposition: 1
public WordParagraph AddNote(WordDocument document, String text) #
Returns: WordParagraph

Adds a small muted source or coverage note separated from preceding content.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
text System.String requiredposition: 1
public Void AddPageChrome(WordDocument document, String title, String product, String scope) #
Returns: Void

Adds title and scope running headers and product, scope and page-total footers.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
title System.String requiredposition: 1
product System.String requiredposition: 2
scope System.String requiredposition: 3
public Void ApplyCellTone(WordTableCell cell, String tone, String? tint = null) #
Returns: Void

Applies a semantic text tone and optional tint after the table's base styling.

Parameters

cell OfficeIMO.Word.WordTableCell requiredposition: 0
The cell to format.
tone System.String requiredposition: 1
Text color as RGB hex.
tint System.String? = null optionalposition: 2
Optional background color as RGB hex; null retains the current fill.
public Void ApplyCountTable(WordTable table, Boolean hasHeader = true) #
Returns: Void

Styles a compact count table with content-sized columns and a right-aligned value column and header.

Parameters

table OfficeIMO.Word.WordTable requiredposition: 0
hasHeader System.Boolean = true optionalposition: 1
public Void ApplyKeyValueTable(WordTable table, Boolean hasHeader = true, Boolean allowRowSplit = false) #
Returns: Void

Styles a key/value or definition table with all labels and values aligned left, including numbers.

Parameters

table OfficeIMO.Word.WordTable requiredposition: 0
hasHeader System.Boolean = true optionalposition: 1
allowRowSplit System.Boolean = false optionalposition: 2
public Void ApplySpacerCell(WordTableCell cell, String background = "FFFFFF") #
Returns: Void

Formats an empty, unpadded cell used as a gutter between cards.

Parameters

cell OfficeIMO.Word.WordTableCell requiredposition: 0
Destination cell.
background System.String = "FFFFFF" optionalposition: 1
Page background as RGB hex.
public Void ApplyTable(WordTable table, Boolean hasHeader = true, Boolean allowRowSplit = false, Boolean alignNumericColumns = true) #
Returns: Void

Applies horizontal hairlines, a muted header, and matched header/value alignment for numeric columns. Cell fills are retained.

Parameters

table OfficeIMO.Word.WordTable requiredposition: 0
The table to style.
hasHeader System.Boolean = true optionalposition: 1
Whether the first row contains column labels.
allowRowSplit System.Boolean = false optionalposition: 2
Whether long evidence rows may continue on another page.
alignNumericColumns System.Boolean = true optionalposition: 3
Whether columns containing only numbers should align right, including their headers.
public Void ApplyTypography(WordDocument document) #
Returns: Void

Applies body typography and dark headings to existing document paragraphs without restyling tables.

Parameters

document OfficeIMO.Word.WordDocument requiredposition: 0
public Void ApplyValueCard(WordTableCell cell, String label, String value, String tone, String tint) #
Returns: Void

Formats a value card with a small label, emphasized value and a semantic top rule.

Parameters

cell OfficeIMO.Word.WordTableCell requiredposition: 0
Destination cell.
label System.String requiredposition: 1
Short label above the value.
value System.String requiredposition: 2
Evidence or state to emphasize.
tone System.String requiredposition: 3
Rule color as RGB hex.
tint System.String requiredposition: 4
Background color as RGB hex.
public Void FitTableColumnsToHeaders(WordTable table, params Int32[] relativeWidths) #
Returns: Void

Fits relative column widths within the current table/container width while reserving room for each header's longest word and horizontal padding.

Parameters

table OfficeIMO.Word.WordTable requiredposition: 0
A populated table with one unmerged header cell per column. Apply header typography before sizing.
relativeWidths System.Int32[] requiredposition: 1
Non-negative column weights; omitted weights give equal desired widths. The values need not sum to 100.

Exceptions

  • InvalidOperationException – The header minima exceed the available width, or the table has merged or irregular rows.
public Void SetCellText(WordTableCell cell, String text) #
Returns: Void

Writes multiline text into an empty table cell with paper typography.

Parameters

cell OfficeIMO.Word.WordTableCell requiredposition: 0
text System.String requiredposition: 1

Properties

public String FontFamily { get; set; } #

Gets or sets the body typeface.

public String DisplayFontFamily { get; set; } #

Gets or sets the display typeface.

public String Ink { get; set; } #

Gets or sets the primary text color, as RGB hex.

public String Muted { get; set; } #

Gets or sets secondary text color, as RGB hex.

public String Accent { get; set; } #

Gets or sets the eyebrow and label accent, as RGB hex.

public String Surface { get; set; } #

Gets or sets the quiet table header and metric surface, as RGB hex.

public String Border { get; set; } #

Gets or sets horizontal table rule color, as RGB hex.

public UInt32 RuleSize { get; set; } #

Gets or sets the hairline thickness in eighths of a point (4 is 0.5 pt).

public Double TableFontSizePoints { get; set; } #

Gets or sets table body type size in points. Header cells use 9 points.

public Int16 TableCellVerticalPadding { get; set; } #

Gets or sets top and bottom table-cell padding in twentieths of a point.

public Int16 TableCellHorizontalPadding { get; set; } #

Gets or sets left and right table-cell padding in twentieths of a point.

public Double TableParagraphSpacingPoints { get; set; } #

Gets or sets spacing before and after table paragraphs, in points.

public Double? TableLineSpacingPoints { get; set; } #

Gets or sets exact table line spacing in points; null preserves inherited line spacing.