Deleting 'Sent' items NOT in other folders

Posted on 2000-03-17
Last Modified: 2013-12-18
Is there an elegant way to identify items in the sent mail that are not in other folders?   If an item is put into another folder from the 'Sent' folder, and the item is deleted from the sent folder, the 'copy' in the other folder also disappears.   I assume that that is because only a link is set up between the base item and the folder.

Would like to reduce the size of the 'Sent' folder to be only items that are 'stored' in other folders, or, alternatively, find a way to put an actual copy of the document into the folder, instead of a link, then we can delete all the items in the sent folder completely, until the next run of the cleanup.
Question by:mwking
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3

Accepted Solution

Arunkumar earned 500 total points
ID: 2630532
Hi mwking !!!

Here is a simple code to acheive your request.

1. Create a Shared Folder Named "Unique Folder" in your mail db.
2. Create an Agent that runs manually from actions menu and runs on selected documents.
3. Paste the following code in your Agent and save it.
4. Go to the sent Folder and select all documents (Ctrl+A).
5. Use Actions menu and Run the agent that you have created on the selected documents.
6. Watch for the status bar for the script completion.
7. Open the "Unique Folder" to find the documents that are found only in your sent box and not in any other Folders !!!!

Here is the Code for the Agent.....

     Dim ss As New notessession
     Dim ws As New notesuiworkspace    
     Dim db As notesdatabase
     Dim view As NotesView    
     Dim doc As notesdocument    
     Dim tempdoc As notesdocument    
     Dim swapdoc As notesdocument
     Dim dc As NotesDocumentCollection
     Dim Ctr As Double
     Set db = ss.CurrentDatabase
     Set view = db.GetView("($Sent)")
     Set dc = db.UnprocessedDocuments
     Set doc = dc.GetFirstDocument
     Ctr = 1
     Do While Not doc Is Nothing
          unid = doc.UniversalID    
          Flag = "NotFound"
          Forall fols In db.Views                                            
               If Not fols.Name = "($Sent)" Then                    
                    If fols.IsFolder Then                        
                         Set tempdoc = fols.GetFirstDocument        
                         If Not tempdoc Is Nothing Then
                              Do While Not tempdoc Is Nothing                              
                                   unid2 = tempdoc.UniversalID                              
                                   If unid = unid2 Then
                                        Flag = "Found"
                                        Exit Do                                                        
                                   End If                                                                                                                      
                                   Set tempdoc = fols.GetNextDocument(tempdoc)
                         End If                        
                    End If                    
               End If                        
               If Flag = "Found" Then
                    Exit Forall
               End If
          End Forall                    
          If Flag = "NotFound" Then
               Call doc.PutInFolder("Unique Folder")              
               Print Ctr & ". document(s) Put in Unique Folder"
               Ctr = Ctr + 1
          End If
          Set doc = dc.GetNextDocument(doc)
     If Ctr = 1 Then
          Print "All the selected documents are found to be in one more folder(s)"
          Print "Successfully transferred " & Ctr - 1 & " documents to Unique Folder"
     End If

Cool Ain't ???

Good Luck !!!


Expert Comment

ID: 2636024

Lotus notes is a Database. Folders are the result of particular query ...It's a view ... When you delete a message , you delete data ...

sent = all data sended
received = all data receive
forum = all messages with response(s)
-> don't touch ...

You can transfer data in another database but I think is a bad way.

Expert Comment

ID: 2639571
Hi Frache !!!

I'm sorry. I did not get you at all.
Could you be more specific and elaborate on your comment ???


What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 2639888

Lotus Notes is a database "like" Access  ,SQL server, or Oracle.
Each user have a little database who contain all messages.
With a database when you want obtain (extract) data, you make a query.
When you click on sent folder, you execute a query.
When you click on received folder, you execute another query.
A "view" is a particular query.
"sent" folder is a view.
"received" folder is a view.
"all messages" is a view
etc ...
With a view you see a part of your database.
When you create a new folder you create a new query = a new view. Not a "real" folder.

When you delete a message in a view you delete data in your database.

If you want duplicate data you must create a new database, and delete data after.

Expert Comment

ID: 2639892
To create new database you can use replication process.

Author Comment

ID: 2640457
Regarding the comment from 'frache':  Am aware that Lotus Notes/Domino is a DB.   The real issue is how to identify those items that are listed in the sent folder as being tagged into other folders/views, and to avoid deleting those that are tagged into other folders/views, thereby keeping those items that are, in the users eyes, worthy of keeping.

Author Comment

ID: 2640776
On pasting the code into the agent, I get an error message regarding a formula error:
'An operator or semicolon was expected but none was encountered: ss'
referencing the first line of the code.

Did you test this yet??


Expert Comment

ID: 2642868

Make sure that you paste the code in the script options initialise event.

I guess you are trying to paste
it in the formula event.

Good Luck !



Author Comment

ID: 2649716

We are getting errors in the Script Initialise event.   Please review the code and let us know.   The strange stan-alone 'If' is flagged and the error posted is :
"Agentname: Initialize: 34: Unexpected En-of-Line; Expected : Expression"

If we remove the "If", we get a pile of mis-matched "End" statements.

I suspect that there is a condition missing in the version of the code posted above>



Expert Comment

ID: 2660378
Hi Mic,

I have just checked the script that i have posted.

Check - manually from actions menu.
Run on - Selected documents
Copy the code to clipboard

paste it between the sub & End sub of the initialize event.

I did not get any errors and the code is perfectly workin.

All the loops and conditions are complete.  

Good Luck !



Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here:
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question