How to differentiate “documents” of Folders created by user in Lotus Notes?
-
10-07-2019 - |
Question
I am able to access User Made Folder as:
NotesView folder = _notesDatabase.GetView(folderName);
NotesDocument folderDoc = folder.GetFirstDocument();
But problem is that it can consist of "Mail","Calendar" and "To Do".
I am not able to differentiate them. Any ideas?
Solution
To differentiate by document type, you can generally use the "form" field value on a document. So, after you get the document handle (the NotesDocument object), use getItemValue to get the value of the form field. For example:
...
NotesDocument folderDoc = folder.getFirstDocument();
String sForm = folderDoc.getItemValue("form");
if (sForm == "Memo") {
// Mail
}
if (sForm == "Appointment") {
// Calendar entry
}
if (sForm == "Task") {
// To Do
}
...
OTHER TIPS
The NotesView has a NotesView.IsFolder and NotesView.IsPrivate
IsPrivate- Read-only. Indicates whether an entry is specific to an individual.
Hope that helps. For more information goto http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.help.domino.designer85.doc/DOC/H_WHAT_S_NEW_IN_RNEXT_CHAP.html
and search for NotesView
Josh