[]
Creates a new custom theme based on the specified base theme.
If baseTheme is null, the new theme is created from the Office theme.
If themeName is null or empty, a unique custom theme name is generated automatically.
public ITheme Add(string themeName, ITheme baseTheme = null)
Public Function Add(themeName As String, Optional baseTheme As ITheme = Nothing) As ITheme
| Type | Name | Description |
|---|---|---|
| string | themeName | The name of the new theme. If |
| ITheme | baseTheme | The theme to copy as the base for the new theme. If |
| Type | Description |
|---|---|
| ITheme | The newly created ITheme. |
Themes themes = new Themes();
ITheme baseTheme = Themes.Badge;
ITheme customTheme = themes.Add("Custom Badge", baseTheme);
workbook.Theme = customTheme;
| Type | Condition |
|---|---|
| ArgumentException | if |