Checks the specified WebFile object out 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.Checkout(ForceCheckout)
expression An expression that returns a WebFile object.
ForceCheckout Optional Boolean. Forces a checkout, even if the file is already checked out. Default value is False.
The ForceCheckout argument provides the administrator with the ability to force a checkout in cases where a file has been checked out by a user who is unavailable to check the file back in.
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 CheckoutFile()
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