Showing posts with label Sharepoint 2010 theme. Show all posts
Showing posts with label Sharepoint 2010 theme. Show all posts

Thursday, December 15, 2011

Revert back to default theme in Sharepoint 2010 programmatically

We can set a custom theme in this manner:
SPWeb objectWeb = objectSite.OpenWeb();
ThmxTheme.SetThemeUrlForWeb(objectWeb , "/_catalogs/theme/CustomTheme.thmx", true);

what if we want to revert back to default theme?
call the method again with a null parameter:
ThmxTheme.SetThemeUrlForWeb(web, null, true);