Share via


DocumentBase.Background 屬性

取得或設定 Shape,表示指定文件的背景影像。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public Property Background As Shape
public Shape Background { get; set; }

屬性值

型別:Microsoft.Office.Interop.Word.Shape
Shape ,表示指定文件的背景影像。

備註

只有在 Web 版面配置檢視中才可以看見背景。

範例

下列程式碼範例會將文件的背景設定為圖片。 此範例會假設在 C 的根目錄中含有名為 Image.jpg 的檔案。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

    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 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間