Remove Lotus Notes design element inheritance programmatically

前端 未结 1 1252
独厮守ぢ
独厮守ぢ 2021-01-15 04:33

As part of an effort to create a rudimentary revision control system, I would like to programmatically disable design element level inheritance on a Lotus Notes template. I

1条回答
  •  走了就别回头了
    2021-01-15 05:14

    The following sub seems to work, it removes the flag from any design element a 7.0.3 client can produce. I got the clues about NotesNoteCollection from Ian's blog entry on the same subject:

    Private Sub clearDesignInheritance(db As notesdatabase)
        On Error Goto errorthrower
    
        Dim nc As NotesNoteCollection
        Set nc = db.CreateNoteCollection(True) ' Select all note types...
        nc.SelectDocuments=False ' ...except data documents.
    
        Call nc.BuildCollection
    
        Dim noteid As String
        noteid = nc.GetFirstNoteId
    
        Dim doc As notesdocument
    
        Do Until noteid=""
            Set doc = db.GetDocumentByID(noteid)
            If doc.HasItem("$Class") Then
                Call doc.RemoveItem("$Class")
                Call doc.save(False,False,False)
            End If
            noteid = nc.GetNextNoteId(noteid)
        Loop
    
        Exit Sub
    ErrorThrower:
        Error Err, Error & Chr(13) + "Module: " & Cstr( Getthreadinfo(1) ) & ", Line: " & Cstr( Erl )
    End Sub
    

    0 讨论(0)
提交回复
热议问题