Managing Source Control Projects in Microsoft FrontPage

Microsoft FrontPage Visual Basic

Managing Source Control Projects in Microsoft FrontPage

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 "$/Coho Winery" is a valid Visual SourceSafe project, the following statement assigns the active Web site to a Visual SourceSafe project.

    ActiveWeb.RevisionControlProject = "$/Coho Winery/Inventory"
  

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

Note  To run this example, you must have a Web site called "C:\My Documents\My Web Sites\Coho Winery". You may create two files called "index.htm" and "footnote.htm" or substitute file names of your choice.

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

    Set myWeb = Webs.Open("C:\My Documents\My Web Sites\Coho Winery")
    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 = ""