Unable to delete design elements using NotesnoteCollection

Hi all,

I was trying to delete an outline using Notesnotecollection, But notesnotecollection.remove() function was unable to delete it, I paste the code below, plz help me where I go wrong…

Set nc = curdb.CreateNoteCollection(False)

nc.SelectOutlines = True

Call nc.BuildCollection

nid = nc.GetFirstNoteId

For i = 1 To nc.Count

nextid = nc.GetNextNoteId(nid)

set docnc = curdb.GetDocumentByID(nid)

subj = docnc.GetItemValue(“$Title”)(0)

If subj = “Main-OutlineTest” Then

       Call nc.Remove(nid)

End If

nid = nextid

Next

Thanks In Advance

thomas

Subject: Unable to delete design elements using NotesnoteCollection

NotesNoteCollection.Remove doesn’t delete anything. It only removes a note from the NotesNoteCollection. To delete a note, you would have to use call docnc.Remove.

/Peter

Subject: RE: Unable to delete design elements using NotesnoteCollection

Thanks a lot Peter…it helped me a lot