Solved

Mail in what folders(s)?

Posted on 2003-11-17
10
484 Views
Last Modified: 2013-12-18
Hi

How can I add a column that shows what folders the different mails are stored in?

I'm using Notes 4.6.7
0
Comment
Question by:klunde
  • 5
  • 3
  • 2
10 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9764181
First, you need to enable IMAP-compatible folder handling.  To do this, run the server CONVERT command with the -m paraneter against the mailbox, e.g., LOAD CONVERT -M mail\klunde.nsf

0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764193
Interesting task. But you cannot do it in a column formula. The only way is to write this information into the document, which is probably could be done at postdragdrop event of the database, and in every part of code where you are moving documents to folders.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764263
Or and there is an event QueryAddToFolder  for the views and folders which is exactly what you need.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9764332
But that only soves half your problem; the other half is even more diificult.

When IMAP references are enabled, the following additional features are available for each document:

1) When accessed via NotesDocument (or lotus.notes.Document), there is a property called FolderReferences.  This property is an array of strings.  The strings are folder names.  But there is no equivalent @Function or field

2) There are three special fields on teh document $Folder, $FolderRef, and $FolderRefFlags.  $FolderRef is the source of information for FolderReferences.  But, while FolderReferences contains view names, $FolderRef does not. Instead, it is a text list of folder UniversalID strings, the 32-hex-digit internal key of a folder's design record. FolderReferences is "nice enough" to look up taht information for you.

3) Two special views are added.  One, ($FolderRefInfo), is all the document categorized on $FolderRef.  the other view shows a list of all folders, with two columns.  the first column is the folder's UNID, the second column is teh folder's name.  the first column is sorted.
0
 
LVL 2

Expert Comment

by:ksi2001
ID: 9764406
qwaletee: in order to use these properties klunde should upgrade to R5

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 31

Accepted Solution

by:
qwaletee earned 50 total points
ID: 9764412
Now, how do you put it all together?  The view column can't make use of FolderReferences, because it is a property of the object model, while columns onlyhave fields and @functions.  The only field it has is $FolderRefs, and that would work, except I'm sure showing the folder UNID instead of its name is unacceptable.

So, what can you do?  There are two ways to handle it.

1) Don't show a column.  Instead, add a view action taht when clicked displasy teh highlighted document's folders.  the following code wuld do the trick:
Dim s as new notesSession
If Not s.currentdatabase.folderreferencesEnabled Then
  Msgbox "This database does need CONVERT -M before this feature will work"
  End
End If
Dim folderList as string
Forall foldername in s.DocumentContext.folderReferences
  folderList = folderList & Chr$(13) & folderName
End Forall
If folderList = "" Then
  MsgBox "No folders for this document"
Else
  Msgbox "Folders:" & folderList
End If

2) You can run code on your documents that will add a field to the document conatining the folder name. the code is fairly simple -- similar to teh code above.  But...
a) it would have to be run as an agent against all existing documents
b) it would have to run against all messages when they arrive
c) you would have to add it in to all the Move to folder objects and Add to folder events
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9764417
No, they are available in 4.6 as well.
0
 

Author Comment

by:klunde
ID: 9769584
This looks very promesing!

But a slight problem. My Notes states that .folderreferencesEnabled is not a member of this class.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9773477
Hmm... folder references might have been added to the object model in 5, I'll have to check.  But the $Folder field hs been there since 4.5 or 4.6 for sure.  You can see this if you have it enabled for your malbox.

Here is sample code that would be the equivalent if you cold not use folder references in the object model...

**** Instead of:

Forall foldername in s.DocumentContext.folderReferences
  folderList = folderList & Chr$(13) & folderName
End Forall


**** Use:

Dim folderNames List as string, folderName as string, folder as notesDocument
Forall folderID in s.DocumentContext.~$FolderRef
  If IsElement(folderNames(folderID)) Then
    foldername = folderNames(folderID)
  Else
    set folder s.currentDatabase.getDocumentByUNID(folderID)
    foldername = folder.~$Title(0)
    foldernames(folderID) = folderName
  End If
  folderList = folderList & Chr$(13) & folderName
End Forall
0
 

Author Comment

by:klunde
ID: 9777002
This works!
Great! Thanks!

(after changing to "set folder = s.curr.....")
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now