shuping
asked on
invoke lotus notes application from VB
I want to invoke the lotos notes application and execute the lotus notes command to start a new message application.
I do not know how to link the lotus notes
I do not know how to link the lotus notes
ASKER
I got the error message from running the above recommended code. message is " Database shuping han has not yet opened"
I tried to open my e-mail database which need password to open. would you please tell me how I can open this database.
By the way you mentioned that I cannot use the lotus notes @command in VB. would you please tell me how I can execute the lotus notes command after creating the object.
What I want to do is:
run VB programm to open lotus notes application new memo and attach the letter which is written in Word. With the recepient's name, address added automatically and default subject text is also added to subject field.
I tried to open my e-mail database which need password to open. would you please tell me how I can open this database.
By the way you mentioned that I cannot use the lotus notes @command in VB. would you please tell me how I can execute the lotus notes command after creating the object.
What I want to do is:
run VB programm to open lotus notes application new memo and attach the letter which is written in Word. With the recepient's name, address added automatically and default subject text is also added to subject field.
ASKER
I got the error message from running the above recommended code. message is " Database shuping han has not yet opened"
I tried to open my e-mail database which need password to open. would you please tell me how I can open this database.
By the way you mentioned that I cannot use the lotus notes @command in VB. would you please tell me how I can execute the lotus notes command after creating the object.
What I want to do is:
run VB programm to open lotus notes application new memo and attach the letter which is written in Word. With the recepient's name, address added automatically and default subject text is also added to subject field.
I tried to open my e-mail database which need password to open. would you please tell me how I can open this database.
By the way you mentioned that I cannot use the lotus notes @command in VB. would you please tell me how I can execute the lotus notes command after creating the object.
What I want to do is:
run VB programm to open lotus notes application new memo and attach the letter which is written in Word. With the recepient's name, address added automatically and default subject text is also added to subject field.
ASKER
Hi,
Could anyone tell me how to use shell(), linktopic, linkitem, linkmode to link lotus notes application.
I want to do following:
by running a VB executable, user can open the lotus notes application new memo, passing the e-mail address from address book and attach word document to the new memo. subject field should get default value. All this should be done when user press a button on the VB form.
Shuping
Could anyone tell me how to use shell(), linktopic, linkitem, linkmode to link lotus notes application.
I want to do following:
by running a VB executable, user can open the lotus notes application new memo, passing the e-mail address from address book and attach word document to the new memo. subject field should get default value. All this should be done when user press a button on the VB form.
Shuping
ASKER
The redbook you recommended is very helpful
Thank you
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
u dont have to use DDE, its not advisable
Here is a simple code to do that:
Private Sub Command1_Click()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf As Object
Dim nt As Object
Set session = CreateObject("Notes.NotesS ession")
Set db = session.GETDATABASE("", "mail\gus.nsf")
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "Paul Rony"
doc.Subject = "New Memo"
Set rtf = doc.CREATERICHTEXTITEM("Bo dy")
Call rtf.APPENDTEXT("Anything Goes!")
Call rtf.ADDNEWLINE(2)
Call rtf.EMBEDOBJECT(1454, "", "c:\loc.txt") 'use the same parameters except the filename
Call doc.Send(False)
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub
Private Sub Command1_Click()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf As Object
Dim nt As Object
Set session = CreateObject("Notes.NotesS
Set db = session.GETDATABASE("", "mail\gus.nsf")
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "Paul Rony"
doc.Subject = "New Memo"
Set rtf = doc.CREATERICHTEXTITEM("Bo
Call rtf.APPENDTEXT("Anything Goes!")
Call rtf.ADDNEWLINE(2)
Call rtf.EMBEDOBJECT(1454, "", "c:\loc.txt") 'use the same parameters except the filename
Call doc.Send(False)
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub
ASKER
The last sample code you provide to me is helpful.
Thank you
Shuping
Thank you
Shuping
ASKER
Hi ghassan99,
This simple sample code did work well. However, if I want to review/check before I send out the mail, I am unable to stop. I have tried to find the possiblitity. Unfortunately, I did not fine out.
Would you please give me some comments
Shuping
Private Sub Command1_Click()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf As Object
Dim nt As Object
Set session = CreateObject("Notes.NotesS ession")
Set db = session.GETDATABASE("", "mail\gus.nsf")
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "Paul Rony"
doc.Subject = "New Memo"
Set rtf = doc.CREATERICHTEXTITEM("Bo dy")
Call rtf.APPENDTEXT("Anything Goes!")
Call rtf.ADDNEWLINE(2)
Call rtf.EMBEDOBJECT(1454, "", "c:\loc.txt") 'use the same parameters except the filename
Call doc.Send(False)
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub
This simple sample code did work well. However, if I want to review/check before I send out the mail, I am unable to stop. I have tried to find the possiblitity. Unfortunately, I did not fine out.
Would you please give me some comments
Shuping
Private Sub Command1_Click()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf As Object
Dim nt As Object
Set session = CreateObject("Notes.NotesS
Set db = session.GETDATABASE("", "mail\gus.nsf")
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "Paul Rony"
doc.Subject = "New Memo"
Set rtf = doc.CREATERICHTEXTITEM("Bo
Call rtf.APPENDTEXT("Anything Goes!")
Call rtf.ADDNEWLINE(2)
Call rtf.EMBEDOBJECT(1454, "", "c:\loc.txt") 'use the same parameters except the filename
Call doc.Send(False)
Set doc = Nothing
Set db = Nothing
Set session = Nothing
End Sub
What do u mean?
This function handles the sending:
Call doc.Send(False)
u can precede this with a msgbox to show u what will be sent...and if confirmed u can continue to the Call doc.Send(False) else exit the sub
This function handles the sending:
Call doc.Send(False)
u can precede this with a msgbox to show u what will be sent...and if confirmed u can continue to the Call doc.Send(False) else exit the sub
ASKER
Hi ghassan99,
Thanks for your rapid responce and sharing your knoweldge with me. The question is that I want to see the "memo"'s send page with the attached file ane then press send button instead of sending directly without notising anything. At that point the user can enter the recipient e-mail.
Thank you
Shuping
Thanks for your rapid responce and sharing your knoweldge with me. The question is that I want to see the "memo"'s send page with the attached file ane then press send button instead of sending directly without notising anything. At that point the user can enter the recipient e-mail.
Thank you
Shuping
Create a form in VB and add text fields for recepients email and body field and just substitue those inside the formulas...like
doc.SendTo = "Paul Rony" becomes doc.SendTo = txtRecepient.text
Then u can add a command button on the VB form which only sends the memo. name the command button 'Send' and put inside it the above code after u modify it.
doc.SendTo = "Paul Rony" becomes doc.SendTo = txtRecepient.text
Then u can add a command button on the VB form which only sends the memo. name the command button 'Send' and put inside it the above code after u modify it.
ASKER
Hi ghassan99,
Thanks very much for your quick response. What you suggested is not bad idea. I also considered the similar features as u recommended. However, I want the user to stop at the lotus notes new memo and select the recipients e-mail from lotus notes address database. Could you give me some suggestion.
Thank you very much
Shuping
Thanks very much for your quick response. What you suggested is not bad idea. I also considered the similar features as u recommended. However, I want the user to stop at the lotus notes new memo and select the recipients e-mail from lotus notes address database. Could you give me some suggestion.
Thank you very much
Shuping
Anyway, I think when u start this program in the first place Notes should be open...I suggest u remove the doc.send command and switch to Notes (while ur VB program is running) u will see it open with the new memo
ASKER
Hi ghassan99,
If I remove the doc.send then the notes new memo never opened, even the notes login window can not prompt.
Shuping
If I remove the doc.send then the notes new memo never opened, even the notes login window can not prompt.
Shuping
Dim session As NOTESSESSION
Dim db As NOTESDATABASE
Dim view As NOTESVIEW
Dim doc As NOTESDOCUMENT
Set session = CreateObject("Notes.NotesS
Set db = session.GETDATABASE("", "test.nsf") 'name of ur application
Set view = db.GETVIEW("test") 'name of a view inside ur application
Set doc = view.GETFIRSTDOCUMENT 'gets the first doc in that view
All type of objects use the same properties and methods as in notes, u can check the object browser in VB to see all objects and their relevant methods and properties, and u can check the help in Notes. Its really simple and fun. u cant use the @commands of Notes in VB.