Is there a way to capture source & destination folders when you folder a doc from within the doc?

I am looking to build some workflow tracking into a mail database, specifically to log when a document is moved to any folder (to capture what folder it has been filed into, when, and by who).

We’ve been able to implement a partial solution by adding some code to the Queryaddtofolder event of all the folders in the DB. This code works when you drag and drop a document, and when you use the Folder\Move to Folder action from the view.

However, it DOESN’T work when you are actually in the document, and use the Folder\Move to Folder action in the memo form. I’m guessing that the Queryaddtofolder event is not being triggered because we are not at the view level.

I’ve tried to write some different code to replace the Folder\Move to Folder action button in the form, that uses the following logic:

1 - get a list of the existing folders that the document is in, using NotesDocument.FolderReferences

2 - show the folder dialog, using NotesUIWorkspace.Folder

3 - get a second list of the folders that the document is in, using the same method as step 1

4 - compare the results of steps 1 and 3, and evaluate the from/to folders based on what has changed

5 - populate the workflow fields

However, the folder references in step 3 are not being updated while the document is still open.

Does anyone have any suggestions about how I can capture the source and destination folders when filing a document from within the document? Is there an event that will ALWAYS be triggered when filing a document, regardless of whether you are in a view or in the document itself?

Subject: Is there a way to capture source & destination folders when you folder a doc from within the doc?

A suggestion might be to do your logic at closing of the database (or better) at opening of the database in a next session.

Subject: RE: Is there a way to capture source & destination folders when you folder a doc from within the doc?

Thanks for your response Rob, but I don’t understand your suggestion. If I’m in a document, and click on the Folder / Move to Folder action button, how is closing the database going to help? I want the action logged at the same time that the document is moved into a folder.

Please clarify, thanks.

Subject: RE: Is there a way to capture source & destination folders when you folder a doc from within the doc?

I understood that you are doing some work to find out in what folder some documents are located. I meant to say that you could do this at db opening, so that when the opening is completed all folder info is up-to-date.

Subject: RE: Is there a way to capture source & destination folders when you folder a doc from within the doc?

Perhaps I need to clarify the situation. I know what folder a document is in at the time I open the document. I am trying to log the result of moving the document to a new folder using the ‘Folder/Move to Folder’ action button in the form. This action does not seem to trigger any of the events that are triggered when you do the same action at the view level.

Does anyone know of a way to capture the “destination” folder information when this action is performed from within the form?

Subject: Is there a way to capture source & destination folders when you folder a doc from within the doc?

It’s a long shot after such a long while, but did you ever find a solution? I am also struggling with folderreferences from an open document. From the view, it seems to work as a charm.