_Application.SetDefaultTheme Method
Sets a default theme for Microsoft Word to use with new documents, e-mail messages, or Web pages.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Sub SetDefaultTheme ( _
Name As String, _
DocumentType As WdDocumentMedium _
)
'Usage
Dim instance As _Application
Dim Name As String
Dim DocumentType As WdDocumentMedium
instance.SetDefaultTheme(Name, DocumentType)
void SetDefaultTheme(
string Name,
WdDocumentMedium DocumentType
)
Parameters
- Name
Type: System.String
Required String. The name of the theme you want to assign as the default theme plus any theme formatting options you want to apply. The format of this string is "theme nnn" where theme and nnn are defined as follows:
String
Description
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\Themes.) You must use the folder name for the theme rather than the display name that appears in the Theme dialog box (Theme command, Format menu).
nnn
A three-digit string that indicates which theme formatting options to activate (1 to activate, 0 to deactivate). The digits correspond to the Vivid Colors, Active Graphics, and Background Image check boxes in the Theme dialog box (Theme command, Format menu). If this string is omitted, the default value for nnn is "011" (Active Graphics and Background Image are activated).
- DocumentType
Type: Microsoft.Office.Interop.Word.WdDocumentMedium
Required WdDocumentMedium. The type of new document to which you are assigning a default theme.
Remarks
Setting a default theme will not apply that theme to the blank document automatically created when you start Word. Any new documents you create after that will have the default theme.
You can also use the ThemeName property to return and set the default theme for new e-mail messages.