Link to home
Start Free TrialLog in
Avatar of CyberUnDead
CyberUnDead

asked on

VBA Automation Lotus Notes 7.0.2

I have installed the trial versions of both Domino and the Lotus Notes Client ( http://www.ibm.com/developerworks/offers/sek),  I am looking to automate using Microsoft Access.

My email code works but I am getting a password prompt via the Notes Client.

I am trying to implement the suggestions from Q_21380011.html but I am getting an error:
Object doesn't support this property or method (438)

When I early bind I do not see an Initialize method.
My error would occur on the third line in sample code window below.

According to this IBM document for version 6 one should use Lotus.NotesSession instead of Notes.NotesSession but I get 429 (can't create object error) when I try that.

Any ideas experts?

Dim s as object
Set s = CreateObject("Notes.NotesSession")
Call s.Initialize("password")

Open in new window

Avatar of puppydogbuddy
puppydogbuddy

see this link for vba code for Lotus Notes automation thru Access.
                    http://www.fabalou.com/VBandVBA/lotusnotesmail.asp
Avatar of CyberUnDead

ASKER

puppydogbuddy:

  The author of the code in the link you provided is doing what I attempting to accomplish.  In line #16 the author is using late binding to the Lotus Automation class and in line #18 he/she is able to use the Initialize method which is where my trouble begins.  I changed my line #3 above from Call s.Initialize("password") to just s.Initialize("password") but the same results.  It is complaining that the method doesn't exist.
Did you eliminate the line below from the code, as suggested?
         MailDoc.CREATERICHTEXTITEM ("Attachment")

see if this link has any helpful info:
            http://www.granite.ab.ca/access/email/lotusnotes.htm
this link has code snippets:
               http://www.granite.ab.ca/access/email/lotusnotessample.htm
puppydogbuddy:

Thanks for all the information.  After further research (EE: Q_23229240.html) using IBM's documentation at http://publib-b.boulder.ibm.com/lotus/c2359850.nsf/Main?OpenFrameSet for Domino 8.  I am having trouble getting their example code to work.  

I am going to reinstall the client on a different PC to see if I get different results.  Thanks again for you assistance.  

I will leave this question open for a little while longer so I can report back my results.
Dim s As NotesSession
Set s = CreateObject("Lotus.NotesSession")
Call s.Initialize 'Error
MsgBox s.CommonUserName, , "Common user name"

Open in new window

NotesSession is not initialized in last example

In Visual Basic (.NET) :




Imports Domino
' ---
dim s as Domino.NotesSession
dim db as Domino.NotesDatabase
' ---
 
s = New NotesSession
 
' if password is provided, no password dialog will appear
strPw = "myPassword"
objSess.Initialize(strPw)
 
' open Notes database
objDb = objSess.GetDatabase("", "MyDatabaseName.nsf")
 
...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CyberUnDead
CyberUnDead

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial