Jump to content

Lotus Notes API


Recommended Posts

Has anyone using lotus notes tried to use the API through AutoIt?...

$ReturnCode = DllCall("c:\notes\nnotes.dll","int","NSFDbOpen","str","c:\notes\data\lkeys.nsf","int*",0)
If $ReturnCode[0] <> 0 Then Exit
$hNSF = $ReturnCode[2]

$ReturnCode = DllCall("c:\notes\nnotes.dll","int","NSFDbGetBuildVersion","int",$hNSF,"int*",0)
If $ReturnCode[0] <> 0 Then
   DllCall("c:\notes\nnotes.dll","int","NSFDbClose","int",$hNSF)
   Exit
EndIf

MsgBox(4096,"",$ReturnCode[2])

DllCall("c:\notes\nnotes.dll","int","NSFDbClose","int",$hNSF)

I have tried cdecl and stuff... before I "tear it up", I am just wondering if anyone else has tried.

Lar.

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Link to comment
Share on other sites

  • Developers

I haven't used the DLL but have written several scripts using The COM interface which works fine:

$Session = ObjCreate("Notes.NotesSession")
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

oooo ... there is a COM interface ... I will need to find that reference... thanks.

Lar

I have a redbook called "COM Together with Domino", file sg245670.pdf.

Let me know when you want me to make it available.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm bumping this because I'm trying to work with Lotus through COM. I know that I can't call any methods or properties until I can actually get the COM object associated with Lotus, and I haven't been able to do that. Here's my test code:

$session = ObjGet("","Lotus.NotesSession")

if not IsObj($session) then
    Msgbox(0,"Status","Couldn't attach to Lotus.")
else
    Msgbox(0,"Status","Attached to Lotus.")
endif

So far, IsObj($session) always returns false. I've been reading sg245670.pdf, but I'm having trouble understanding how to apply it to AutoIt.

Link to comment
Share on other sites

I think its like I posted a few posts up:

$Session = ObjCreate("Notes.NotesSession")

:D

Ok, that works fine for creating a Lotus object, but I want to make a script that performs operations on an existing instance of Notes. Specifically I want to create appointments in a Lotus calendar, and I don't want to use a whole lot of Send() And when I try to use ObjGet("Notes.NotesSession"), it doesn't attach.
Link to comment
Share on other sites

  • Developers

Ok, that works fine for creating a Lotus object, but I want to make a script that performs operations on an existing instance of Notes. Specifically I want to create appointments in a Lotus calendar, and I don't want to use a whole lot of Send() And when I try to use ObjGet("Notes.NotesSession"), it doesn't attach.

Pretty sure you can create the Calendar entry that way too. The script I have written using the COM interface all start with the ObjCreate() which will either start Notes when its not active or else just work fine in the "background".

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Pretty sure you can create the Calendar entry that way too. The script I have written using the COM interface all start with the ObjCreate() which will either start Notes when its not active or else just work fine in the "background".

Jos

Ok, I'll try using ObjCreate() to work with Lotus when it's already open. At http://www.ibm.com/developerworks/lotus/li.../ls-COM_Access/, it says that the COM Toolkit is no longer available. Where can I find something like it?

Link to comment
Share on other sites

Larry try telling the Rational guys to implement an API for all the products they based on eclipse plattform.

Like :

ClearQuest

Lotus Notes

RDA

RSA

RDZ

and so on.

Besides one question, what kind of scripts are you trying to script for Notes? Or just some nice udfs?

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Besides one question, what kind of scripts are you trying to script for Notes? Or just some nice udfs?

Mega

asking me?

I'm trying to make a script that gets info about an appointment from one application:

-time

-date

-details

-whose appointment it is

and then goes into Lotus and sets the appointment in the appropriate person's calendar.

I am a little stuck at this point. Trying to get the name for my server, using:

$session = ObjCreate("Notes.NotesSession")
$sname=$session.servername

because I need to use GetDatabase. But calling Servername keeps giving an error "The requested action with this object has failed."

feel like I'm in a little over my head here.

Link to comment
Share on other sites

  • Developers

I cannot test here but does something like this work?

$sname = $Session.GetEnvironmentString("MailServer", True)

This is an example that should open the default mailfile:

$MailDB = $Session.GetDatabase ("", "")
If $MailDB.ISOPEN <> True Then
    $MailDB.OPENMAIL
EndIf
$MailServer = $MailDB.Server
$MailFileName = $MailDB.FileName
$MailFilePath = $MailDB.FilePath
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 7 years later...

I know this an old Lotus Notes Forum, but does anyone have any idea how to do the print command through Autoit.  I can get everything to work but the Print part when I convert it over. How do we use the Lotus Script Call function in Autoit?

The Lotus Script is as follows:

Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Call uidoc.Print
End Sub

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...