Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordBackground

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

Represents the document background settings.

Inheritance

  • object
  • WordBackground

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 3

Constructors

WordBackground 2 overloads
public WordBackground(WordDocument document) #

Creates a background manager for the specified document.

Parameters

document OfficeIMO.Word.WordDocument required
Parent document.
public WordBackground(WordDocument document, OfficeColor color) #

Creates a background with the specified color.

Parameters

document OfficeIMO.Word.WordDocument required
Parent document.
color OfficeIMO.OfficeColor required
Initial color.

Methods

public WordBackground SetColor(OfficeColor color) #

Sets the background color using a OfficeColor.

Parameters

color OfficeIMO.OfficeColor required
Color value.

Returns

WordBackground The current instance.
SetImage 2 overloads
public WordBackground SetImage(string filePath, OfficeLength? width = null, OfficeLength? height = null) #

Sets the background image for the document.

Parameters

filePath string required
Path to the image file.
width OfficeIMO.OfficeLength? = null optional
Optional physical width of the image.
height OfficeIMO.OfficeLength? = null optional
Optional physical height of the image.

Returns

WordBackground The current instance.
public WordBackground SetImage(Stream imageStream, string fileName, OfficeLength? width = null, OfficeLength? height = null) #

Sets the background image for the document.

Parameters

imageStream System.IO.Stream required
Stream containing image data.
fileName string required
Name of the image file.
width OfficeIMO.OfficeLength? = null optional
Optional physical width of the image.
height OfficeIMO.OfficeLength? = null optional
Optional physical height of the image.

Returns

WordBackground The current instance.

Properties

public OfficeColor? Color { get; set; } #

Gets or sets the background color; automatic or missing colours return null.