Evotec

Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 144
Forks 12
Open issues 16
PowerShell Gallery downloads 150,904
Release v0.2.0
Language: C# Updated: 2026-04-06

API Reference

Cmdlet

Set-OfficeWordBackground

Namespace PSWriteOffice
Inputs
OfficeIMO.Word.WordDocument
Outputs
OfficeIMO.Word.WordDocument

Sets the background for a Word document.

Remarks

Sets the background for a Word document.

Examples

Authored help example

Apply a solid background color.

PS>


Set-OfficeWordBackground -Color '#f4f7fb'
        

Sets the document background to the provided hex color.

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-OfficeWordBackground -Color <String> [-Document <WordDocument>] [-PassThru] [<CommonParameters>]
#
Parameter set: Color

Parameters

Color String requiredposition: 0pipeline: False
Background color in hex format (#RRGGBB or RRGGBB).
Document WordDocument optionalposition: namedpipeline: True (ByValue)
Document to update when provided explicitly.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.

Outputs

OfficeIMO.Word.WordDocument

Set-OfficeWordBackground [-Document <WordDocument>] [-Height <Nullable`1>] -ImagePath <String> [-PassThru] [-Width <Nullable`1>] [<CommonParameters>]
#
Parameter set: Image

Parameters

Document WordDocument optionalposition: namedpipeline: True (ByValue)
Document to update when provided explicitly.
Height Nullable`1 optionalposition: namedpipeline: False
Optional background image height in pixels.
ImagePath String requiredposition: 0pipeline: False
Path to the background image.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Width Nullable`1 optionalposition: namedpipeline: False
Optional background image width in pixels.

Outputs

OfficeIMO.Word.WordDocument