Hi. I have a following problem.In a PostSave event I have the following script:
Sub Postsave(Source As Notesuidocument)
Dim Workspace As New NotesUIWorkspace
Dim Doc As NotesDocument
Source.Refresh
Set Doc = Source.Document
If Doc.HasItem(“tmpFile”) Then
If Doc.HasItem(“File”) Then
Call Doc.RemoveItem(“File”)
End If
Set tmpItem = Doc.GetFirstItem(“tmpFile”)
Call tmpItem.CopyItemToDocument (Doc,“File”)
Call tmpItem.Remove
Call Doc.Save(True,False,True)
End If
End Sub
It works for the first and second time of running this script, but for the third time and more it throws an error 4005 on the following line:
Call tmpItem.CopyItemToDocument (Doc,“File”)
Can anyone help me to understand what is wrong? This error is being thrown for the third time I save any document, which has that script in PostSave event.
Thanks in advance. Jiri