hi all i have a mail file to receive emails and several other programs read these email (by pop3) and do auto processing …the mail file is in lotus…as of now the outlook client which retrives these mail leave a copy at the server which we want to change but also want to have the email copy in lotus but not on this email mail file for various reason …
i did wrote an agent using lotus script and the agent works fine (runs on new mail arrival ) to copy all the document from one database to other database …the other database created is also a mail file but with diffrent name …i am using doc.copytodatabase(db2) syntax to acheive the result in the agent
The problem i face is the document is copied to the new database on a new mail arrival but it is seen in all document view …
i want this to be in inbox view /folder …
is there a way out to put some codes in the same agent
i do not want to run one more agent to move documents from all document view to inbox
is there a specific syntax in which i can directly put the doc in a particular folder across database …
doc.Putinfolder works fine within one database but not across database
Why do you post pseudocode and not the actual code you are using? You are not supplying the details I need to solve the problem.
The original document gets put into the inbox in the first database, because that’s what happens to mail when it’s received. Your agent is not causing that.
The copy document probably isn’t getting put into the folder because you failed to save it before trying to put it into a folder.
You should use CopyToDatabase, not CopyAllItems – that will be more efficient. Since CopyToDatabase also saves the new docuent, you should be able to call PutInFolder right after that. Of course the folder name must be in quotes, and the full correct name of the inbox folder is “($Inbox)”.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim db2 As NotesDatabase
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Set db = session.CurrentDatabase
Set db2 = New NotesDatabase("Villages01", "mail\EOR.nsf")
'Messagebox( "got db2 init " )
Call db.UpdateFTIndex(True)
Set dc = db.FTSearch("villages-mcc.org", 0)
Set doc = dc.GetFirstDocument
Set doc2=New NotesDocument(db2)
'If doc.IsNewNote Then
'Use the call statement because to return
'value is needed
' Call doc.CopyToDatabase(db2)
'Else
'Messagebox( "This document has been saved. It's not new." )
'End If
While Not(doc Is Nothing)
'Use the call statement because to return
'value is needed
'Set doc2=doc
'If doc.IsNewNote Then
Call doc.CopyToDatabase(db2)
Messagebox( "This document has been saved. " )
'Else
' Messagebox("This is old doc and not copied to EOR ")
'End If
'Call doc2.PutInFolder("$Inbox")
Set doc = dc.GetNextDocument(doc)
Wend
End Sub
This is the code as of now i am running on a new mail arrival …
The new incoming mail is copied to EOR database and is in all document view
and i can’t put that in inbox view of EOR database …
hope now you got the problem …
clarification
i know that original document on a mail file goes in to the inbox …when i used copyallitems code after the pop3 download still i have the same mails in the inbox of database A as it has copied to database A inbox onemore time when the agent runs and not to database B
in the above code putinfolder doesn’t work as we directly copy this doc to database
and it is in all doc view instead of inbox as it is a copied item and not a new mail arrived