Search DominoPower's 11,441 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Working with folders in mail and how to find lost documents (continued)

01 Dim sess As New notessession
02 Dim db As notesdatabase
03 Set db = sess.currentdatabase
04 db.FolderReferencesEnabled = True
05 Dim docs As NotesDocumentCollection
06 Dim doc As NotesDocument
07 Set docs = db.unprocesseddocuments
08 Set doc = docs.getfirstdocument
09
10 While Not(doc Is Nothing)
11 Forall folder In doc.FolderReferences
12 If folder <> "" Then
13 Print doc.subject(0) & " -> folder: " & folder
14 End If
15 End Forall
15 Set doc = docs.GetNextDocument(doc)
16 Wend

Again, in line 4 we make sure that we have FolderReferences enabled on the database. By the time we get to line 10 we already have a collection of all selected documents in the view -- db.unprocesseddocuments in line 8 and have got the first one. In line 11 we start to look at the set of folderreferences per document, and in line 12 we make sure that we ignore ones with no value. All non-blank folder references are printed in line 13.

OK, I said this was crude. Your implementation will of course have a complete and polished UI, but I wanted to deal just with the core code.

In a real implementation you will need to pay attention to one or two other things. Firstly, the Sent "folder" is actually a view, not a folder, so this code won't report items that are just in the Sent view. If seeing them is important, then you will need to check the same field items on each document as are used in the Sent view's selection formula. The view selection is:

SELECT DeliveredDate = "" & PostedDate != "" & !(@IsMember("S"; ExcludeFromView))

A LotusScript equivalent could be:

n = evaluate({@ismember("S",ExcludeFromView}), doc)
if not (doc.hasitem(doc.delivereddate)) and doc.hasitem(posteddate) and n <> 0 then... 'document will be in the Sent view

You will also probably want to translate view names like ($Inbox) and ($JunkMail) back to the folder names that are used in the mail database UI as specified in the various Outlines in the mail database, to give a consistent look and feel to the whole experience, should you add this code to the mail database. My customer, who took this code and extended it, also reports that on rare occasions accessing a document's FolderReferences raised error 17412, so you might want to add a trap for that.

And, of course, you will invent a complete UI to manage the user experience, won't you?

Have fun, and good hunting!

David Gewirtz is the author of How To Save Jobs and Where Have All The Emails Gone? For more than 20 years, he has analyzed current, historical, and emerging issues relating to technology, competitiveness, and policy. David is the Editor-in-Chief of the ZATZ magazines, is the Cyberterrorism Advisor for the International Association for Counterterrorism and Security Professionals, and is a member of the instructional faculty at the University of California, Berkeley extension. He can be reached at david@zatz.com and you can follow him at http://www.twitter.com/DavidGewirtz.


« Previous  ·  1  ·  2  ·  3
Other articles you might like
Home > Strategies > Email Management (60 articles)
   Using the Notes Client with Gmail
   Using the Notes client with Hotmail (or not)
   Is English-only a viable mail management strategy?
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Home > Strategies > Document Management (14 articles)
   An application for scanning physical mail and distributing it virtually
   Evaluating your Domino Document Manager (Domino.Doc) transition options
   What to look for in a Domino-based document management solution
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login