C# – How to differentiate “documents” of Folders created by user in Lotus Notes

clotus-notes

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?

Best Answer

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
}
...