将指定 WebFile 对象签入到版本控制项目。
注意 使用本方法之前必须在适当的位置有版本控制项目。有关版本控制项目的详细信息,请参阅管理版本控制项目。
expression.Checkin(Comment, KeepCheckedout)
expression 返回 WebFile 对象的表达式。
Comment 可选,String 类型。说明字符串。
KeepCheckedout 可选,Boolean 类型。保留文件为签出状态。默认值是 False。
KeepCheckedout 参数提供当用户将文件签入 Microsofe Visual Source Safe 中以记录更改时,让该文件保持签出状态的功能。该功能不会应用于 FrontPage Light Weight 版本控制。
本示例中的程序执行下列步骤:
注意 要运行本示例,必须在包含文件“C:\My Document\My Webs\Rogue Cellars\Zinfandel.htm”(对于在 Microsoft Windows 上运行的服务器)或“C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars\Zinfandel.htm”(对于在 Windows NT 上运行的服务器)的站点的适当位置上有一个版本控制项目。或者,您可以用您所选择的站点和文件来代替。
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