API Reference
WordPaperStyle
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) #WordParagraphAdds a shaded callout with a 3 pt left rule. The caller supplies semantic theme colors.
Parameters
- document OfficeIMO.Word.WordDocument
- title System.String
- body System.String
- tone System.String
- tint System.String
public WordTable AddCountTable(WordDocument document, IEnumerable<KeyValuePair<String, String>> rows, String keyHeader = "Metric", String valueHeader = "Count") #WordTableAdds a content-sized count table. Unknown values may be supplied as text alongside numeric counts.
Parameters
- document OfficeIMO.Word.WordDocument
- rows System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>
- keyHeader System.String = "Metric"
- valueHeader System.String = "Count"
public Void AddCover(WordDocument document, String eyebrow, String title, String subtitle) #VoidAdds a cover's eyebrow, title and subtitle using the paper type scale.
Parameters
- document OfficeIMO.Word.WordDocument
- eyebrow System.String
- title System.String
- subtitle System.String
public WordTable AddKeyValueTable(WordDocument document, IEnumerable<KeyValuePair<String, String>> rows, String keyHeader = "Field", String valueHeader = "Value", Boolean allowRowSplit = false, Boolean hasHeader = true) #WordTableAdds a two-column evidence table using the paper rules and preserving multiline values.
Parameters
- document OfficeIMO.Word.WordDocument
- The destination document.
- rows System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>
- Labels and their evidence text, in display order.
- keyHeader System.String = "Field"
- First column label.
- valueHeader System.String = "Value"
- Second column label.
- allowRowSplit System.Boolean = false
- Whether long evidence may continue on another page.
- hasHeader System.Boolean = true
- 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) #WordTableAdds a row of metric cards, each with a large value, label and optional qualifier.
Parameters
- document OfficeIMO.Word.WordDocument
- metrics OfficeIMO.Word.WordPaperMetric[]
public WordParagraph AddNote(WordDocument document, String text) #WordParagraphAdds a small muted source or coverage note separated from preceding content.
Parameters
- document OfficeIMO.Word.WordDocument
- text System.String
public Void AddPageChrome(WordDocument document, String title, String product, String scope) #VoidAdds title and scope running headers and product, scope and page-total footers.
Parameters
- document OfficeIMO.Word.WordDocument
- title System.String
- product System.String
- scope System.String
public Void ApplyCellTone(WordTableCell cell, String tone, String? tint = null) #VoidApplies a semantic text tone and optional tint after the table's base styling.
Parameters
- cell OfficeIMO.Word.WordTableCell
- The cell to format.
- tone System.String
- Text color as RGB hex.
- tint System.String? = null
- Optional background color as RGB hex; null retains the current fill.
public Void ApplyCountTable(WordTable table, Boolean hasHeader = true) #VoidStyles a compact count table with content-sized columns and a right-aligned value column and header.
Parameters
- table OfficeIMO.Word.WordTable
- hasHeader System.Boolean = true
public Void ApplyKeyValueTable(WordTable table, Boolean hasHeader = true, Boolean allowRowSplit = false) #VoidStyles a key/value or definition table with all labels and values aligned left, including numbers.
Parameters
- table OfficeIMO.Word.WordTable
- hasHeader System.Boolean = true
- allowRowSplit System.Boolean = false
public Void ApplySpacerCell(WordTableCell cell, String background = "FFFFFF") #VoidFormats an empty, unpadded cell used as a gutter between cards.
Parameters
- cell OfficeIMO.Word.WordTableCell
- Destination cell.
- background System.String = "FFFFFF"
- Page background as RGB hex.
public Void ApplyTable(WordTable table, Boolean hasHeader = true, Boolean allowRowSplit = false, Boolean alignNumericColumns = true) #VoidApplies horizontal hairlines, a muted header, and matched header/value alignment for numeric columns. Cell fills are retained.
Parameters
- table OfficeIMO.Word.WordTable
- The table to style.
- hasHeader System.Boolean = true
- Whether the first row contains column labels.
- allowRowSplit System.Boolean = false
- Whether long evidence rows may continue on another page.
- alignNumericColumns System.Boolean = true
- Whether columns containing only numbers should align right, including their headers.
public Void ApplyTypography(WordDocument document) #VoidApplies body typography and dark headings to existing document paragraphs without restyling tables.
Parameters
- document OfficeIMO.Word.WordDocument
public Void ApplyValueCard(WordTableCell cell, String label, String value, String tone, String tint) #VoidFormats a value card with a small label, emphasized value and a semantic top rule.
Parameters
- cell OfficeIMO.Word.WordTableCell
- Destination cell.
- label System.String
- Short label above the value.
- value System.String
- Evidence or state to emphasize.
- tone System.String
- Rule color as RGB hex.
- tint System.String
- Background color as RGB hex.
public Void FitTableColumnsToHeaders(WordTable table, params Int32[] relativeWidths) #VoidFits 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
- A populated table with one unmerged header cell per column. Apply header typography before sizing.
- relativeWidths System.Int32[]
- 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) #VoidWrites multiline text into an empty table cell with paper typography.
Parameters
- cell OfficeIMO.Word.WordTableCell
- text System.String
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
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.