Cannot create DocLink in DB enabled document lock

The following script makes an error about the operation privillage after enabling the Database the document lock. The line of “Call it.AppendDocLink(doc, “”)” in the script is likely to have a problem.

Anyone, Help!

Sub Click(Source As Button)

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument



Dim ws As New NotesUIWorkspace

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Dim db As NotesDatabase

Set db = doc.ParentDatabase



Dim newdoc As New NotesDocument(db)

newdoc.Form="Main Topic"

Dim it As New NotesRichTextItem(newdoc,"Body")

newdoc.Subject = "Sub: "

    newdoc.foo = "foo"

    ...

Call it.AppendDocLink(doc, "")

Call newdoc.Save(True, True)

    ...

End Sub