# Set-OfficeWordBackground

Sets the background for a Word document. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Word.WordDocument`

**Outputs**

`OfficeIMO.Word.WordDocument`

**Source**

[SetOfficeWordBackgroundCommand.cs:29](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Word/SetOfficeWordBackgroundCommand.cs#L29) 

Sets the background for a Word document.

## Syntax

```
Set-OfficeWordBackground
[-Color] <String>
[-Document <WordDocument>]
[-PassThru]
[<CommonParameters>]
```

[#](#method-set-officewordbackground-string-worddocument-switchparameter)

Parameter set: `Color`

```
Set-OfficeWordBackground
[-Document <WordDocument>]
[-Height <Double>]
[-ImagePath] <String>
[-PassThru]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-set-officewordbackground-worddocument-double-string-switchparameter-double)

Parameter set: `Image`

## Examples

### Apply a solid background color while composing a report.

```powershell
New-OfficeWord -Path .\BrandedReport.docx {
    Set-OfficeWordBackground -Color '#f4f7fb'
    Add-OfficeWordParagraph -Text 'Executive summary'
}
```

Sets the document background to the provided hex color and continues normal document composition.

### Apply an image background to an existing document.

```powershell
$doc = Get-OfficeWord -Path .\Draft.docx
$doc | Set-OfficeWordBackground -ImagePath .\Assets\Background.png -Width 600 -Height 800 -PassThru |
    Save-OfficeWord -Path .\Draft-Branded.docx
```

Uses OfficeIMO.Word background image support and saves the updated document through the standard save cmdlet.

## Parameters

**-Color String requiredposition: 0sets: Color**

Background color. Named colors and hexadecimal values are accepted.

**-Document WordDocument optionalpipeline: True (ByValue)**

Document to update when provided explicitly.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Height Double optionalsets: Image**

Optional background image height in pixels.

**-ImagePath String requiredposition: 0sets: Image**

Path to the background image.

**-Width Double optionalsets: Image**

Optional background image width in pixels.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:21314581E50298609B0458AA361159D5862C7F83AF47AE62FABCB21ACF693657 -->
