Solved

Using Lotus Notes COM from PB 7.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
edit html 3 135
What is the best editor for PowerShell scripts? 7 94
Could you explain how to manage Maven repository from inside Netbeans IDE ? 2 51
debug as  junit test 4 80
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

805 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