Search code examples
lotus-noteslotusscriptdomino-designer-eclipse

How to remove document after moving from inbox in lotus script?


I am moving a document from inbox to a custom folder it moves successfully but it still appearing in inbox. I want to remove it from inbox. I tried doc.RemoveFromFolder("Inbox") after moving but it does't work for me . Here is my code :

Sub Click(Source As Button)
Dim s As New NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set db = s.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument

Call doc.PutInFolder("Reported Emails")
Call doc.RemoveFromFolder("Inbox")

End Sub

Solution

  • Your code is absolutely ok, but you need to give the "real" name of the folder. Just check in your designer: The name of the folder that is titled "Inbox" in your client is named "($Inbox)" in Designer. Your code needs to use that:

    Call doc.RemoveFromFolder("($Inbox)")