Managing Source Control Projects

See Also

Microsoft FrontPage provides two methods of versioning, FrontPage Light Weight source control (also known as Microsoft Office-style locking or FrontPage-based locking) and Microsoft Visual SourceSafe. FrontPage Light Weight source control is the default versioning method for source control projects in FrontPage.

Versioning provides a measure of control over users who maintain pages on your Web sites. Both source control methods provide checkin, checkout, undocheckout. Visual SourceSafe provides other versioning capabilities, such as version tracking and rollback features.

Creating a source control project

To create a new source control project, you set the RevisionControlProject property to the path of the project (for Visual SourceSafe) or to <FrontPage-based Locking> as shown in the following statement.

ActiveWeb.RevisionControlProject = "<FrontPage-based Locking>"

Assuming that the string "$/Rogue Cellars" is a valid Visual SourceSafe project, the following statement assigns the active web to a Visual SourceSafe project.

ActiveWeb.RevisionControlProject = "$/Rogue Cellars/Inventory"

The following example creates a source control project and checks out two files.

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). You may create two files called "index.htm" and "footnote.htm" or substitute file names of your choice.

Private Sub CreateSourceControl()
Dim myWeb As Web
Dim myProject As String
Dim myFile1 As WebFile
Dim myFile2 As WebFile

Set myWeb = Webs.Open("C:\My Documents\My Webs\Rogue Cellars")
Set myFile1 = myWeb.RootFolder.Files("index.htm")
Set myFile2 = myWeb.RootFolder.Files("footnote.htm")

myProject = "<FrontPage-based Locking>"

myWeb.RevisionControlProject = myProject
myFile1.Checkout
myFile2.Checkout
End Sub

The Checkout method provides a Boolean force checkout argument for administrators.

Removing a source control project

Once a project is completed, you may decide to remove versioning. To do this, set the RevisionControlProject property to an empty string ("") as shown in the following statement.

myWeb.RevisionControlProject = ""

Switching between FrontPage Light Weight and Visual SourceSafe projects

To switch between these two types of versioning, you must first set the RevisionControlProject property to an empty string ("") as shown in the following statement.

myWeb.RevisionControlProject = ""