Moving documents to a folder

pts.
Tags:
Lotus Domino
Can someone tell me how to write an agent that will select ONLY about 3000 the oldest documents in the inbox and move them to a folder?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Do you really need an agent to do what either Rules (within the mailfile) or Archiving (to a local archive) will do for you? Not enough info here.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MHanson
    Your solution in in the NotesViewEntryCollection class using the PutInFolder Method. You can cut and paste this code but suggest you add some print statements so you can see it run. If your mailbox has 10k messages like mine it will take a bit to run! Good luck - Mike ************************* %REM This code will read your inbox and dump half its entries into a folder called "Cheese". %END REM Sub Initialize Dim s As New notessession Dim db As notesdatabase Dim v As notesview Dim vec1 As notesviewentrycollection Dim vec2 As notesviewentrycollection Dim ve As notesviewentry Set db = s.currentdatabase Set v = db.GetView("($Inbox)") count% = v.entrycount %REM this will get about half your inbox, you can figure out how to get exactly 3000 if that's what you want, count the view to make sure you have at least that many entries and then use the GetLastEntry method and work backwards to get your collection %ENDREM If count% Mod 2 = 0 Then n& = count%/2 Else n& = (count% - 1)/2 End If Messagebox Str(n&) Set vec1 = v.AllEntries Set ve = vec1.GetNthEntry(n&) While Not ve Is Nothing n& = n& + 1 If n& > count% Then Goto finito ' this avoids the out of range error at the end of the loop Call vec2.AddEntry(ve) Set ve = vec1.GetNthEntry(n&) Wend finito: Call vec2.PutAllInFolder("Cheese") End Sub
    35 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following