本文為機器翻譯文章。如需檢視英文版,請選取 [原文] 核取方塊。您也可以將滑鼠指標移到文字上,即可在快顯視窗顯示英文原文。
譯文
原文

DocumentBase.ApplyTheme 方法 (String)

 

將佈景主題套用至文件 (如果已開啟文件)。

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

public void ApplyTheme(
	string name
)

參數

name
Type: System.String

佈景主題的名稱,加上您想要套用的任何佈景主題格式化選項。

The format of the name string is "theme nnn" where theme and nnn are defined as follows:

theme – The name of the folder that contains the data for the requested theme. (The default location for theme data folders is C:\Program Files\Common Files\Microsoft Shared\Themes11.) You must use the folder name for the theme rather than the display name that appears in the Theme dialog box.

nnn – A three-digit string that indicates which theme formatting options to activate (1 to activate, 0 to deactivate). The digits correspond to the VividColors, ActiveGraphics, and BackgroundImage check boxes in the Theme dialog box. If this string is omitted, the default value for nnn is "011" (Active Graphics and Background Image are activated).

The following code example uses the M:Microsoft.Office.Tools.Word.DocumentBase.ApplyTheme(System.String) method to apply the "Afternoon 011" theme to the current document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentApplyTheme()
{
    this.ApplyTheme("AFTRNOON 011");
}
回到頁首
顯示: