Question Locked

What is the folder my lotus notes email resides in?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

Can someone please assist with me returning the folder my email resides in. Using
If doc.GetItemValue("Subject")(0) = "TEST" Then

I can trap if the subject matches my requirement. I want to return the folder the email resides in. My tree structure of my $INBOX is:

FOLDER
FOLDER\Type A
FOLDER\Type B
FOLDER\TYPE C.

I want the variable to return "FOLDER\TYPE B" (assumming the email is located in that folder.

Andrew

2 replies

by dogknees

Andrew,

The NotesDocument object doesn't store the folders it lives in internally, rather, each folder records the documents that live in it.

So, you need to look at the NotesView object for each Folder in your database and the AllDocuments member. If you iterate through the alldocuments collection for each folder, you can then check if the documents UNID matches the one you're looking for, if so, you've found one folder your document is in.

Something that may impact your design is that a document can reside in numerous folders at any time. You'll need to handle this in the code you write.

Regards

This discussion is closed to new replies.