Add Method (Properties Collection) Example

This example adds a new file to the list of items in the Properties collection.

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

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

myCopyright = "Copyright 1999 by Rogue Cellars"
Set myWeb = Webs.Open("C:\My Webs\Rogue Cellers")
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