Chinaunix

标题: 如何实现退出时不保存的功能? [打印本页]

作者: huangjian2004    时间: 2007-01-05 13:46
标题: 如何实现退出时不保存的功能?
Sub Click(Source As Button)
        Dim ws As NotesUiWorkspace
        Dim uidoc As NotesUIDocument
        Dim doc As NotesDocument
        Dim sess As NotesSession     
        Dim rep  As Integer
       
        Set ws = New NotesUIWorkspace
        Set sess = New NotesSession     
        Set uidoc = ws.currentdocument
        Set doc = uidoc.document
        uidoc.AutoReload = False
        uidoc.EditMode = True
        rep = ws.DialogBox( "TrainingRecord",True, True, False, False, _
        False, False, "Please input." )
       
        If rep Then         
                Dim tmp As String
                Dim tmpRecords As Variant
                Dim tmpType As String
                Dim tmpTraining As String
                Dim tmpInstructor As String
                Dim tmpLicense As String
                Dim x As Integer         
               
                tmpRecords = doc.Records
                tmpType = doc.Type1(0)
                tmpTraining = doc.Training1(0)
                tmpInstructor = doc.Instructor1(0)
                tmpRecords(X) = "* " & tmptraining & " by: " & tmpInstructor & " " & tmpType
               
                If tmpRecords(0) ="" Then
                        x = 0
                Else
                        x = Ubound(tmpRecords) + 1
                End If
                Redim Preserve tmpRecords(x)
                tmpRecords(x)=doc.Records(0)
                doc.Records = tmpRecords
        End If     
        Call doc.RemoveItem("Type1")
        Call doc.RemoveItem("Training1")
        Call doc.RemoveItem("Instructor1")
        Call doc.RemoveItem("Input1")
        If doc.Save(False,False) Then
                uidoc.AutoReload = True
                Call uidoc.Reload
                Call uidoc.Refresh         
        End If     
End Sub
作者: huangjian2004    时间: 2007-01-08 09:58
标题: 请教!
这网站上有高人吗? 怎么没有回帖的?
作者: qingzhou    时间: 2007-01-08 19:28
Designer里不是有现成的Lotus命令直接调用么。
作者: huangjian2004    时间: 2007-01-09 09:40
标题: Re: 请教!
不太明白,能不能给点提示! Designer里现成的Lotus命令调用是出错的。程序写入后,
运用doc.close出错,运用doc.save的话不保存文件时出错?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2