Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Method 1: Create a Macro to Apply the Theme to the Active Server Page
The following code example allows you to apply the theme to the Active Server Page:
Sub applyatheme()
'x = MsgBox("Do you want to apply a Theme to this page")
'FileSize = oMyFile.Files("test.asp").Properties
myThemeName = "downtown"
Set myFile = ActiveWeb.RootFolder.Files("test.asp")
'myThemeName = ""
Call myFile.ApplyTheme(myThemeName, fpThemePropertiesAll)
End Sub
Sub remove_theme()
myThemeName = ""
Set myFile = ActiveWeb.RootFolder.Files("test.asp")
Call myFile.ApplyTheme(myThemeName, fpThemePropertiesAll)
End Sub
Method 2: Using the "Selected Pages" Option to Isolate a Theme Applied to an Active Server Page
- In the Folder list of Page view, select the Active Server Page to which you want to apply a specific theme.
- On the Format menu, click Theme.
- In the Themes dialog box, select the Theme you want.
- Click OK.
- In Folder view, press CTRL + click to select the pages to which you want to apply a different Theme.
- On the Format menu, click Theme.
- In the Themes dialog box, click to select the "Selected pages" option .
- Click to select the theme you want.
- Click OK.