Hello Everyone

I am a new member to this forum.

I searched for my query in this forum but not able to find the answer. Please forgive me if these kind of questions were already answered in past.

I got a task where I have to to create VBA which will detach attachments from LN inbox mails, delete the attachment, move those mails to a Lotus Notes folder and finally send automatic reply mail to sender.

I am able to detach attachments from mail but not able to move mail documents from Inbox to "Cleared" folder in LN.

This is what I have used :
..................
If (attch.Type = EMBED_ATTACHMENT) Then
attch.ExtractFile sPathToSave & attch.Name 'save attachment to directory
attch.remove 'delete attachment from mail
End If
doc.PutInFolder "Cleared", True 'copy mail to Cleared Folder in LN
doc.Removefromfolder "($Inbox)", True 'delete mail from inbox
........................

This code makes copy of first mail in 'Processed' folder of LN but never delete mail from Inbox. In fact, it create two copies which are seemed to be linked. That means if I delete mails from inbox (after code run) mails also get deleted from 'Processed' folder. Moreover, due to this issue the loop is running on the first mail only.

Can someone please help me and guide me on this.
Thanks.