?
Solved

Using Lotus Notes COM from PB 7.

Posted on 2004-04-05
2
Medium Priority
?
1,067 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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: …
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 and create keystrokes in Netbeans IDE 8.0 for Windows.
Suggested Courses

777 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