Share via


Document.Background Property (2007 System)

Gets or sets a Shape that represents the background image for the specified document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property Background As Shape
'Usage
Dim instance As Document 
Dim value As Shape 

value = instance.Background

instance.Background = value
[BrowsableAttribute(false)]
public Shape Background { get; set; }
[BrowsableAttribute(false)]
public:
property Shape^ Background {
    Shape^ get ();
    void set (Shape^ value);
}
public function get Background () : Shape 
public function set Background (value : Shape)

Property Value

Type: Shape
A Shape that represents the background image for the specified document.

Remarks

Backgrounds are visible only in Web layout view.

Examples

The following code example sets the background of the document to a picture. This example assumes that there is a file named Image.jpg at the root of the C directory.

This example is for a document-level customization.

Private Sub DocumentBackground()
    Me.ActiveWindow.View.Type = Word.WdViewType.wdWebView
    Me.Background.Fill.UserPicture("C:\Image.jpg")
End Sub
private void DocumentBackground()
{
    this.ActiveWindow.View.Type = Word.WdViewType.wdWebView;
    this.Background.Fill.UserPicture("C:\\Image.jpg");
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace