Accessing Mail Database using C++ API

Hi All,

I have one .nsf file named Backup.nsf that contains only documents and no forms,views,agents etc. When a user double clicks on it,i want to add those documents into the Inbox folder of the current logged on user.

Is it possible to add documents into current user mail Inbox. I am using C++ API for implementing the above.but its not adding those documents into mail inbox.How can i add those documents into Inbox.

Please suggest me a way to resolve this problem.

Thanks

Maju

Subject: Accessing Mail Database using C++ API

If you want something to happen on opening your database, you will have to add code in it…

For example, just add a “PostOpen” event in the database script of the Backup.nsf database, written in LotusScript, that:

  • gets the current user’s mail file

  • gets the collection of documents to copy and for each of them, copy to mail file AND calls the “putinfolder” method of NotesDocument.

You could also send an active message to the user, containing a button that opens the backup.nsf database and do the above actions…

Why should you use API for such a simple matter?

Subject: RE: Accessing Mail Database using C++ API

HI,

Thanks for the reply.

I put that copy code in PostOpen event of the database script. But when user double clicks on it, Some errors are showing “Cannot Locate form: Memo” and “Cannot locate Default form” etc. So that Postopen doesn’t executes.

Here Backup.nsf has no forms or views etc. I think it may be the problem.I don’t want to add any forms or views into this Backup.nsf file. This file contains documents only and whenever user tries to open it, i want to show all documents in the inbox of the current user.

Pls tell me a way to resolve this issue.

bye

Maju

Subject: RE: Accessing Mail Database using C++ API

if note complains about missing default view (or form???) why not add them? why are concerned about this?

in your db-script just check if copying has be done (notes.ini, profile, …), copy docs to users mail-box, that’s all. then you can prevent that this db is being opend. and noone will see any of its views…

by the way: “Cannot locate Default form”, why this? when does it appear? db-scripts should be prior to opening any docs.

by the way2: this is a strange kind of workaround. maybe there’s a more commom (and less dirty:) way to solve your problem.