Solved

Using Lotus Notes COM from PB 7.

Posted on 2004-04-05
2
1,055 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to edit a midi track 9 163
What is an NDK ? 3 94
Best free Visio Editor? 2 139
Insert several multiple frames into a single mainframe 3 57
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

920 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

16 Experts available now in Live!

Get 1:1 Help Now