API Reference
Cmdlet
Set-OfficeExcelTheme
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
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:
ContextParameters
- Default SwitchParameter
- Reset the workbook to the built-in OfficeIMO theme.
- Name String
- Optional workbook theme name to apply after writing the theme.
- PassThru SwitchParameter
- Emit workbook theme metadata after applying the update.
- Xml String
- Theme XML to write to the workbook theme part.
- XmlPath String
- 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:
PathParameters
- Default SwitchParameter
- Reset the workbook to the built-in OfficeIMO theme.
- InputPath String
- Workbook path to update.
- Name String
- Optional workbook theme name to apply after writing the theme.
- PassThru SwitchParameter
- Emit workbook theme metadata after applying the update.
- Xml String
- Theme XML to write to the workbook theme part.
- XmlPath String
- 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:
DocumentParameters
- Default SwitchParameter
- Reset the workbook to the built-in OfficeIMO theme.
- Document ExcelDocument
- Workbook to update outside the DSL context.
- Name String
- Optional workbook theme name to apply after writing the theme.
- PassThru SwitchParameter
- Emit workbook theme metadata after applying the update.
- Xml String
- Theme XML to write to the workbook theme part.
- XmlPath String
- Path to a DrawingML theme XML file.
Outputs
System.Management.Automation.PSObject