Why does doc.putinfolder throw 4005 error

The following code produces a 4005 error. at the “putinfolder” method. Documents UNID’s are loaded up into an array via initArray sub.

There is no access issue as the ID I am using has manager access. The folder is a public folder. Have no idea why Notes still throws a 4005 error on this.

Sub addDocuments()

On Error Goto errHandle

Dim i As Integer

Dim session As New notesSession

Dim doc As notesDocument

Dim db As notesDatabase

Dim vw As notesView

Dim iCount As Integer



iCount = 0

Set db =session.CurrentDatabase

Call initArray()

For i = 0 To Ubound(vArr)

	If Trim(vArr(i)) <> "0" Then

		iCount = iCount + 1

		Print "Documents added so far :" + Str(iCount)

		Set doc = db.GetDocumentByUNID(vArr(i))

		Call doc.PutInFolder("General", True)

	End If

Next

Exit Sub

errHandle:

Messagebox Lsi_info(2) + " : " + Str(Err) + " - " + Error(Err) + ", at line " + Str(Erl)

Print Lsi_info(2) + " : " + Str(Err) + " - " + Error(Err) + ", at line " + Str(Erl)

Exit Sub

End Sub

Subject: why does doc.putinfolder throw 4005 error

See if the “Show response documents in a hierarchy” setting is selected for the folder. If it is, try un-checking it.

If you are working with a mail file, many documents have a $Ref but the parent document is not there or you may be moving the response document and the parent is not in the folder. Either way, it will throw some error, not sure if its a 4005 or something else.