API Reference

Cmdlet

Set-OfficeExcelTheme

Aliases: ExcelTheme
Namespace PSWriteOffice
Aliases
ExcelTheme
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Sets or resets the workbook theme package part for an Excel workbook.

Remarks

Sets or resets the workbook theme package part for an Excel workbook.

Examples

Authored help example

Reset and rename the workbook theme.

PS>


$theme = Set-OfficeExcelTheme -Path .\Report.xlsx -Default -Name 'Contoso Workbook Theme' -PassThru
            Get-OfficeExcelSummary -Path .\Report.xlsx |
                Select-Object Path, WorksheetCount
        

Writes the built-in OfficeIMO workbook theme and updates its theme name.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Set-OfficeExcelTheme [-Default] [-Name <String>] [-PassThru] [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Default SwitchParameter optionalposition: namedpipeline: False
Reset the workbook to the built-in OfficeIMO theme.
Name String optionalposition: namedpipeline: False
Optional workbook theme name to apply after writing the theme.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit workbook theme metadata after applying the update.
Xml String optionalposition: namedpipeline: False
Theme XML to write to the workbook theme part.
XmlPath String optionalposition: namedpipeline: False
Path to a DrawingML theme XML file.

Outputs

System.Management.Automation.PSObject

Set-OfficeExcelTheme [-Default] -InputPath <String> [-Name <String>] [-PassThru] [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]
#
Parameter set: Path

Parameters

Default SwitchParameter optionalposition: namedpipeline: False
Reset the workbook to the built-in OfficeIMO theme.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
Name String optionalposition: namedpipeline: False
Optional workbook theme name to apply after writing the theme.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit workbook theme metadata after applying the update.
Xml String optionalposition: namedpipeline: False
Theme XML to write to the workbook theme part.
XmlPath String optionalposition: namedpipeline: False
Path to a DrawingML theme XML file.

Outputs

System.Management.Automation.PSObject

Set-OfficeExcelTheme [-Default] -Document <ExcelDocument> [-Name <String>] [-PassThru] [-Xml <String>] [-XmlPath <String>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Default SwitchParameter optionalposition: namedpipeline: False
Reset the workbook to the built-in OfficeIMO theme.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
Name String optionalposition: namedpipeline: False
Optional workbook theme name to apply after writing the theme.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit workbook theme metadata after applying the update.
Xml String optionalposition: namedpipeline: False
Theme XML to write to the workbook theme part.
XmlPath String optionalposition: namedpipeline: False
Path to a DrawingML theme XML file.

Outputs

System.Management.Automation.PSObject