Solved

Using Lotus Notes COM from PB 7.

Posted on 2004-04-05
2
1,052 Views
Last Modified: 2013-12-26
Hello...I am attempting to make use of the Lotus Notes Lotus.NotesSession COM object from PB 7.  Everything works fine under W2K with a Notes 5 client using the following code:

// create and connect to the session
lole_session = create oleobject
if (lole_session.connecttonewobject("Lotus.NotesSession") < 0) then
  messagebox("Mail Error", "Cannot connect to NOTES~rSending pre-defined e-mail aborted.", stopsign!)
      return false
end if

// get the Notes password
if (len(gs_notes_password) = 0) then
      if (open(w_notes_password, this) < 0) then
            messagebox("Mail Error", "Unable to request the NOTES password~rSending pre-defined e-mail aborted.", stopsign!)
            lole_session.disconnectobject()
            destroy lole_session
            return false
      end if
      
      // store the returned password
      gs_notes_password = message.stringparm
      
      // check for a Cancel button click
      if (len(gs_notes_password) = 0) then
            lole_session.disconnectobject()
            destroy lole_session
            return false
      end if
end if

// initialize the Notes session
lole_session.initialize(gs_notes_password)

// get the mail server and database
ls_server = lole_session.getenvironmentstring("MailServer", true)
ls_database = lole_session.getenvironmentstring("MailFile", true)

// create and address the message
lole_database = lole_session.getdatabase(ls_server, ls_database)
lole_document = lole_database.createdocument()
lole_document.replaceitemvalue("From", lole_session.username)
lole_document.replaceitemvalue("Subject", ps_subject)
lole_document.replaceitemvalue("SendTo", ps_sendto)
lole_document.replaceitemvalue("Status", "")

// save the message to the Sent folder
lole_document.SaveMessageOnSend = true;

// create the message body field and fill it
lole_field = lole_document.createrichtextitem("Body")
lole_field.appendtext(ps_message)
lole_document.save(true, true)
 
// send the message
lole_document.send(false)

// disconnect from the OLE objects
lole_session.disconnectobject()

// destroy the OLE objects
destroy lole_session

The problem is that under Windows XP using an R6 client the code fails on the ConnectToNewObject line.  I suspect that the "Lotus.NotesSession" reference is the issue, but I don't know what a suitable replacement would be.

I don't see either a Lotus.NotesSession or Domino.NotesSession reference in the Win XP registry under either \HKLM\SOFTWARE\Classes or \HKCR but I do under W2K.

Any help would be greatly appreciated.
0
Comment
Question by:llewelm
2 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 10757363
This has been a problem with R6 install.. One alternative is to re-install R6 again..

Take a look at this technote for further info on correcting this issue.. http://www-1.ibm.com/support/docview.wss?rs=899&uid=swg21127601

http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21095746

~Hemanth
0
 
LVL 1

Author Comment

by:llewelm
ID: 10760130
I performed the regsrv32 as was mentioned in the TechNote and the Lotus.NotesSession was added to the registry properly.  I was then able to run the application properly as I had under W2K/R5.

One interesting thing though.  I went back to our system folks to find out how the Notes 6 client was "created".  They indicated that when upgrading our computers from W2K/R5 to Win XP/R6, the Notes 5 client was completely uninstalled and then the R6 client newly installed.  They claimed not to be doing an upgrade.

Anyway, the problem seems to be resolved.  Thanks...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now