Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordTheme

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

The document theme: its colour scheme and its major (headings) and minor (body) fonts. Text, borders and shading that select a theme colour or theme font follow changes made here.

Inheritance

  • object
  • WordTheme

Remarks

Changing the theme also refreshes the literal colour and font values Word stores next to each theme selection, so applications that ignore the theme show the same result.

Usage

Explore 2 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 2

Methods

public OfficeColor? GetColor(WordThemeColor color) #

Gets a colour of the colour scheme, or null when the document has no theme.

Parameters

color OfficeIMO.Word.WordThemeColor required
The scheme slot. Text and background aliases read the dark and light slots.

Returns

OfficeColor?
public void Import(WordDocument source) #

Replaces this document's theme with a copy of another document's theme.

Parameters

source OfficeIMO.Word.WordDocument required
The document or template whose theme to copy. It is not changed; a read-only load is enough.

Exceptions

  • InvalidOperationException – The source document has no theme.
public WordTheme SetColor(WordThemeColor color, OfficeColor value) #

Sets a colour of the colour scheme.

Parameters

color OfficeIMO.Word.WordThemeColor required
The scheme slot. Text and background aliases set the dark and light slots.
value OfficeIMO.OfficeColor required
The new colour.

Returns

WordTheme This theme.

Properties

public string? Name { get; set; } #

Gets or sets the theme name.

public string? MajorFont { get; set; } #

Gets or sets the Latin typeface of the major (headings) font.

public string? MinorFont { get; set; } #

Gets or sets the Latin typeface of the minor (body) font.