Checkin Method

       

Checks the specified WebFile object in to the source control project.

Note   You must have a source control project in place before using this method. For information about source control projects, refer to Managing Source Control Projects.

expression.Checkin(Comment, KeepCheckedout)

expression   An expression that returns a WebFile object.

Comment   Optional String. A description string.

KeepCheckedout   Optional Boolean. Keeps the file checked out. Default value is False.

Remarks

The KeepCheckedout argument provides the ability to have the file remain in a checkedout state while the user checks the file in to Microsoft Visual SourceSafe to record the changes. This does not apply to FrontPage Light Weight source control.

Example

The program in this example performs the following steps:

Note   To run this example, you must have a source control project in place on a web with a file 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). Or, you may substitute a web and file of your choice.

Private Sub CheckinFile()
    Dim myWeb As WebEx
    Dim myFile As WebFile
    Dim myPageWindow As PageWindowEx
    Dim myWelcome As String

    Set myWeb = Webs("C:/My Webs/Rogue Cellars")
    myWelcome = "Welcome to my Web Site!"
    Set myFile = myWeb.RootFolder.Files("Zinfandel.htm")
    myFile.Checkout
    Set myPageWindow = myFile.Edit(fpPageViewNormal)
    With myPageWindow
            myPageWindow.Document.body.insertAdjacentText("BeforeEnd", _
                myWelcome)
        If myPageWindow.IsDirty = True Then myPageWindow.Save
            .Close
    End With
    myFile.Checkin
End Sub