Sumera Subramanian 6.Jul.11 08:59 PM a Web browser Applications Development6.5.5Windows NT
Hi there
I have a scheduled agent (runs on server) that loops through documents in a database and extracts attachments from it to save to a drive on the domino server.
My agent has an error handler to log any errors and then proceed to the next document to process. However on encountering the error "4005: Notes error: File cannot be created", it prints the error message, but then the agent stops executing. This is a problem because I need all the documents to be processed, and any problem attachments get looked at from the list of logged errors.
Attachments do get extracted and saved, so folder permissions etc are not the issue. The agent execution level is 3.
If note.HasItem("MigratedAttachmentsList") Then
Set fileList = note.GetFirstItem("MigratedAttachmentsList")
fileList.Values="" 'reset if attachments are being extracted again
Else
Set fileList = New NotesItem(note, "MigratedAttachmentsList", "New")
fileList.Values="" 'remove rubbish text set above
End If
'extract resumes\cover letters
If note.HasEmbedded Then
If ( rtitem.Type = RICHTEXT) Then
If Isarray(rtitem.EmbeddedObjects) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
strFileName=o.Source
cCode = ReplaceSubstring(cCode, Chr(13), "")
Call o.ExtractFile( "D:\ResumeAttachments\" & strState & "\" & cCode & "-" & strFileName ) --------ERROR AT THIS LINE FOR SOME ATTACHMENTS
Call fileList.AppendToTextList("D:\ResumeAttachments\" & strState & "\" & cCode & "-" & strFileName)
Call note.ComputeWithForm(False, False)
Call note.Save( True, False)
ctr=ctr+1
End If
End Forall
End If
End If
End If
startnext:
Set note = ndcoll.GetNextDocument(note)
Loop