I have PowerBuilder and VB.Net apps that send emails through Lotus Notes. I am using an OLE object to connect to Lotus Notes. How can I close the Lotus Notes application when I opened it using ConnectToNewObject(‘Notes.NotesSession’)? I first use ConnectToObject(‘’, ‘Notes.NotesSession’) to attempt to connect to a running Lotus Notes process. If that fails, I use ConnectToNewObject to open Lotus Notes (I set a flag to indicate that my process opened Lotus). I have no problem with this or any of the commands related to composing and sending the emails. When the emails are sent, I want to close the Lotus Notes application window if my process opened it. I cannot find any way to do this (I found many other people asking this same question in my Google searches but nobody had an answer). Setting a reference to the Lotus application and trying .Quit causes an error and none of my other guesses (Close, Exit, Stop, End, etc) worked. I am releasing the memory and destroying the objects for the session, database, document, and richtextitem objects but that doesn’t kill the Lotus window. Do you know how this can be done or who I might contact with this question?Thanks,
I came across an additional issue related to my original post. In my company, Lotus Notes is replicated to the individual PCs, which send and recieve mail at a time interval specified in the preferences. When my external application uses OLE to open a Lotus Notes session, compose and save the email memo document in the database, and issue the Send command, the email is not actually sent until the next interval or until the user manually has Lotus send and receive emails. I tested this by sending the email from my external application, switching to the Lotus Notes window, and attempting to close it manually (I get a prompt that pending mail needs to be sent). In this case, my original request to find a way to close the Lotus Notes application needs to be amended. I also need to find a way to tell Lotus to send and receive email before I close it.Thanks,
Subject: I’d take a different approach. Consider using COM interfaces instead of OLE, then the user doesn’t need to do anything except maybe enter their password.
I have no experience with COM interfaces. My application has a PowerBuilder front end, so I can write extension classes as wrappers. However, my attempts to find out how to implement a COM interface to Lotus Notes or what functionality would be available to me were not encouraging. I didn’t find any examples I could use and the COM tutorials I found make me think that learning COM could be more involved than I have time for. Can you point me to any decent online tutorials or documentation for COM that I could look at?