Properties Property Example

This example adds a new property and displays it on the active web page.

Note   To run this example, you must have a web called "C:\My Documents\My Webs\Rogue Cellars" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars" (for a server running on Windows NT), and a file called "Zinfandel.htm". Or, you may substitute an alternative web URL or file.

Private Sub CopyrightAdd()
Dim myWeb As Web
Dim myCopyright As String

myCopyright = "Copyright 1999 by Rogue Cellars"
Set myWeb = Webs.Open("C:\My Documents\My Webs\Rogue Cellars")
myWeb.Activate
ActiveWeb.Properties.Add "Copyright", myCopyright
ActiveWeb.RootFolder.Files("Zinfandel.htm").Open
ActiveDocument.body.insertAdjacentText "BeforeEnd", _
    ActiveWeb.Properties("Copyright")
ActivePageWindow.Save
ActiveWeb.Close
End Sub