'Usage Dim instance As SPWeb Dim strNewTheme As String instance.ApplyTheme(strNewTheme) 'Declaration Public Sub ApplyTheme ( _ strNewTheme As String _ )
A string that contains the template ID of a theme that is specified in the SPTHEMES.XML file of the \\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\Locale_ID folder.
\\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\
The following code example applies a specified theme to a site in the current site collection.
Using webSite As SPWeb = SPContext.Current.Site.OpenWeb("Website_URL") webSite.ApplyTheme("Theme_ID") End Using
Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Best Practices: Using Disposable Windows SharePoint Services Objects.