Checks the specified WebFile object into 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. True 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 Microsoft FrontPage Light Weight source control.
Example
The program in this example performs the following items:
- Checks out a file and puts the page in edit mode.
- Adds a welcome message to the page.
- Checks if the open page has been modified.
- Saves the page if it has been modified.
- Closes the file and checks it into the existing source control project.
Note To run this example, you must have a source control project in place on a Web site with a file called "C:\My Documents\My Web Sites\Rogue Cellars\Zinfandel.htm." Or, you may substitute a Web site 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 Web Sites/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