2

I had a script I was running in Notes 8.5 which started a notes session and sent an email with an attachment. It worked perfectly. Then I upgraded to Notes 9.0.1 and now when I try to start a notes session a null is returned. A snipped from the code I used is below. When I echo the server I see the null. Is there something new with Notes 9.0.1 that is required on the session, or are there additional parameters required on the GetEnvironmentString method that I need to provide? Thanks.

    ' Start a session to notes 
    wscript.echo "## Connecting to Lotus Notes session..." 
    Set oSession = CreateObject("Notes.NotesSession") 

    wscript.echo "## GetEnvironmentString..." 
    strServer = oSession.GetEnvironmentString("MailServer",True) 
    wscript.echo("Server           :" & strServer) 

    strUserName = oSession.UserName 

    strMailDbName = Left(strUserName, 1) & Right(strUserName, (Len(strUserName) - InStr(1, strUserName, "")))&".nsf" 
    wscript.echo("MailDbName        :" & strMailDbName) 

    wscript.echo "## Getting current Notes database..." 
    ' open the mail database in Notes 

    set oCurrentMailDb = oSession.CurrentDatabase 
  • 1
    There's probably a problem with the registration of the Notes COM classes. Try opening a command line window, CD to your Notes program directory, and executing the command "regsvr32 nslxbe.dll" – Richard Schwartz Nov 06 '14 at 16:20
  • Richard, that registry works right after I do it, but after some time goes by and my script executes again I'm faced with the same error. Do you have any idea what could be corrupting my registry settings? Thanks – user3411644 Nov 11 '14 at 00:27
  • Are you reinstalling? – Richard Schwartz Nov 11 '14 at 03:56
  • I wasn't planning on reinstalling notes, is that what you recommend? – user3411644 Nov 13 '14 at 14:33
  • and if it is what you recommend, do you recommend going back to notes 8.5? that version never had this issue – user3411644 Nov 13 '14 at 14:34
  • Actually, I was really asking if you had already uninstalled and reinstalled. That's the only thing that I can think of that should remove the registry settings. Well... actually, that's not true. There could be other things. Maybe there's some sort of security software or centrally-managed security policies that are "cleaning" your registry for you. I really can't guess. I've never heard of a case where correctly registered DLLs have their registry settings yanked out from under them. – Richard Schwartz Nov 13 '14 at 16:16
  • I uninstalled Notes 9 and did a clean install of notes 8.5 and the problem is still happening. How can I check the result of the create of the session? I think my problem is that I'm getting a null back from the following commands: Set oSession = CreateObject("Notes.NotesSession") oSession.Initialize – user3411644 Nov 20 '14 at 13:53
  • 1
    A couple of things. 1.) I just noticed that you are using Notes.NotesSession instead of Lotus.NotesSession. That means you are using OLE classes instead of COM classes. Unless you really need one of the NotesUI classes, which are only available via OLE, I would switch to using Lotus.NotesSession. 2. See the question and answer here re testing oSession: http://stackoverflow.com/questions/14507526/error-checking-for-null-in-vbscript 3. Is this running on 32 or 64 bit Windows? – Richard Schwartz Nov 20 '14 at 14:06

0 Answers0