rdclk23
asked on
Create Lotus Notes email from VB - Can't set password
I have some VB code that sends an email. It works fine if I am already logged into Lotus Notes. I want the code to be able to work in batch and send the email when I am not signed on to Notes. When I try and use the 'Initialize' method to set my password, I get an error 'Lotus Notes(88) - R438 "No such property or method". Then Notes pops up a dialog box asking for my password.
global IndSession As Object
set IndSession = nothing
set IndSession = CreateObject("Notes.NotesS ession")
call IndSession.Initialize("myp asword")
Set db = IndSession.GetDatabase("LN MAIL2/SRV/ xxxxxxxx", "mail\xxxxxx.nsf")
global IndSession As Object
set IndSession = nothing
set IndSession = CreateObject("Notes.NotesS
call IndSession.Initialize("myp
Set db = IndSession.GetDatabase("LN
ASKER
Yes, Notes is installed on the machine. It works fine if I type my password in when prompted. I want to suppress the password prompt.
I tried CreateObject("Lotus.NotesS ession") and got an error 'Object Creation failed. Bad Object class.'
I am using Lotus Notes 6.
I tried CreateObject("Lotus.NotesS
I am using Lotus Notes 6.
The password should be your internet password.. not notes id password.
Also try using Call session.InitializeUsingNot esUserName ("name", "password")
name is shortname listed in person doc of address book and password is the internet password
Also try using Call session.InitializeUsingNot
name is shortname listed in person doc of address book and password is the internet password
ASKER
I'm still getting the 'no such property or method' error. Maybe it's a timing thing and Notes is taking a few seconds to open. Can you recommend some VB code like a delay loop that I can put before the Initialize call?
session = CreateObject("Lotus.NotesS ession")
session.Initialize("arsena l13") - here arsenal13 is the password
Partha
session.Initialize("arsena
Partha
I don't think it is a timing issue. It is pretty straightforward.. and you can search in this forum on usage of initialize method
As our guru qwaleete as already describerd earlier in this post :- https://www.experts-exchange.com/questions/21056925/using-visual-basic-to-launch-Lotus-Notes-Email.html
" If you want to rearchitect the way you are doing the code, you COULD throw up a VB dialog with SendTo, etc. fields, prefilled, and allow the user to send the message from within your program, and you could then use the newer COM NotesSession class (Lotus.NotesSession or Domino.NotesSession) to send it without invoking Notes. "
You need to change your code to replace this :-
set IndSession = CreateObject("Notes.NotesS ession")
with
set IndSession = CreateObject("Lotus.NotesS ession") OR set IndSession = CreateObject("Domino.Notes Session")
Also if you search within this forum , there is lots of discussion and working sample codes for your required code.
" If you want to rearchitect the way you are doing the code, you COULD throw up a VB dialog with SendTo, etc. fields, prefilled, and allow the user to send the message from within your program, and you could then use the newer COM NotesSession class (Lotus.NotesSession or Domino.NotesSession) to send it without invoking Notes. "
You need to change your code to replace this :-
set IndSession = CreateObject("Notes.NotesS
with
set IndSession = CreateObject("Lotus.NotesS
Also if you search within this forum , there is lots of discussion and working sample codes for your required code.
ASKER
Thanks for you help folks, but this is going no where. People are giving me suggestions without reading the thread. I withdraw the question.
>> . I withdraw the question.
If you withdraw that I may be able to help :)
If you withdraw that I may be able to help :)
Hi rdclk23,
> Thanks for you help folks, but this is going no where. People are giving me suggestions without
> reading the thread. I withdraw the question.
No, I think you are not reading the answers. Good luck, and, perhaps, good riddance. Sorry, but that was called for.
Cheers!
> Thanks for you help folks, but this is going no where. People are giving me suggestions without
> reading the thread. I withdraw the question.
No, I think you are not reading the answers. Good luck, and, perhaps, good riddance. Sorry, but that was called for.
Cheers!
ASKER
Drop dead. When people keep telling me to use CreateObject("Lotus.NotesS ession")
after I posted the error 'Object Creation failed. Bad Object class.' , I get annoyed. When I say I want to suppress the password prompt and someone responds with a suggestion for more VB dialog boxes, I get annoyed. As I stated in the beginning, the code I have WORKS if Notes if open as a client session. I have since changed my solution to not use email so all of this is mute anyway.
after I posted the error 'Object Creation failed. Bad Object class.' , I get annoyed. When I say I want to suppress the password prompt and someone responds with a suggestion for more VB dialog boxes, I get annoyed. As I stated in the beginning, the code I have WORKS if Notes if open as a client session. I have since changed my solution to not use email so all of this is mute anyway.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try using CreateObject("Lotus.NotesS
~Hemanth