ThmxTheme.SetThemeUrlForWeb method (SPWeb, String, Boolean)

Applies the theme pointed to by the specified URL to the specified web.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Shared Sub SetThemeUrlForWeb ( _
    web As SPWeb, _
    themeUrl As String, _
    shareGenerated As Boolean _
Dim web As SPWeb
Dim themeUrl As String
Dim shareGenerated As BooleanThmxTheme.SetThemeUrlForWeb(web, themeUrl, _
public static void SetThemeUrlForWeb(
    SPWeb web,
    string themeUrl,
    bool shareGenerated


  • themeUrl
    Type: System.String

    The server-relative URL of the theme file.

  • shareGenerated
    Type: System.Boolean

    true if the generated Cascading Style Sheet (CSS) files are shared in the site collection; otherwise, false.


If the specified web had a theme previously applied to it and the theme was not shared, this operation will delete the theme.

See also


ThmxTheme class

ThmxTheme members

SetThemeUrlForWeb overload

Microsoft.SharePoint.Utilities namespace