run lotus notes with parameters from other application

hi all,
I'll be very thankfull for helping me with this.

I'm writing a Java application, and I need by pressing a button in my application, to open or activate the lotus-notes, and automatically open a new mail with "to", "subject", "detailes" allready filled, so the user only have to send the e-mail.

I know how to run lotus-notes from java, but I do not know how to cause it to automatically run a macro that gets parameters from my application, and how this macro should look like.

hoping for help,
Who is Participating?
dbbohlinConnect With a Mentor Commented:
There are a couple of ways you might be able to perform this action.  I am afraid I don't know Java well enough to tell you if you can get to a compose document level from outside of Notes.  From within Notes you do database.createDocument() and push the values into the field before ending the routine and handing it back to the user.

If you can write to the Notes.ini file and can open a database from Java, I have a possible solution for you.  This is a little crude, but might help.

Create a script for the PostOpen action in the Database Script of the mail database you are using.  This script will look for an environmental flag indicating that a memo is to be created. The script then creates the memo and populates the desired fields from other environmental variables.

What your Java needs to do is write those environmental variables to the Notes.ini file and open the session and database for Notes.

The problem with this is that you invalidate the Notes Mail database, which if it is being updated from template on a regular basis or ever upgraded at all will delete all of the changes you had made.

Ok, that is one way.  Another possiblity and I don't know the limitations of Java and Notes to say if this is possible or not.  Is to use CORBA to instaciate your Notes and directly access the functions, forms and fields of the mail database.  I am in the middle of trying to learn this technology and from what I know this should be possible.  But the how, I cannot tell you.

Hope this helps or at least gives you a direction to follow.
In Java you can submit a background memo by setting the necessary parameters like SendTo, CopyTo, BlindCopyTo, Subject & Body fields. Then use the method Send in notesdocument to send the document. There is no need to open the mail and wait for the user to hit the send button.

Good Luck
dovAuthor Commented:
I must open the lotus-notes because the user has to fill in the body of the mail.
dovAuthor Commented:
Adjusted points to 85
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.