steve_mills
asked on
Emailing from VB5
I would like to put an option into my application so the user can email the database to a someone else.
So it would have to open Outlook up and then attach the databse to a new amil message.
Is this possable and if so has any one have some code I can get started with.
Thanks
Steve
So it would have to open Outlook up and then attach the databse to a new amil message.
Is this possable and if so has any one have some code I can get started with.
Thanks
Steve
use this free component: http://www.freevbcode.com/ShowCode.Asp?ID=109
ASKER
This is a good link but I am using VB5.0 sorry
Thanks
Steve
Thanks
Steve
you have 2 options:
1. since you have all the source code, try opening it into VB5 and compile it.
2. Use the DLL and distribute it with your app (do not forget msvbvm60.dll and maybe other requirements that I could tell you).
1. since you have all the source code, try opening it into VB5 and compile it.
2. Use the DLL and distribute it with your app (do not forget msvbvm60.dll and maybe other requirements that I could tell you).
Hi!
Here's a file for you over the net:
View code...
http://www.planetsourcecode.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=5946&lngWId=1
Description: This code will send email through MS Outlook 98, (or the most current version on your computer), using MS Excel 7.0 or higher.
That's it!
glass cookie : )
PS. If you've received an error message saying that 'Retained' is an invalid keyword or something similiar to that, simply open the vbp file in txt format and remove te line:
Retained = 0
That's all : )
Here's a file for you over the net:
View code...
http://www.planetsourcecode.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=5946&lngWId=1
Description: This code will send email through MS Outlook 98, (or the most current version on your computer), using MS Excel 7.0 or higher.
That's it!
glass cookie : )
PS. If you've received an error message saying that 'Retained' is an invalid keyword or something similiar to that, simply open the vbp file in txt format and remove te line:
Retained = 0
That's all : )
ASKER
Can can not open the .vbp files I get an error
Retained is an invalid key.
And I cannot load the dll into my project either.
Thanks
Steve
Retained is an invalid key.
And I cannot load the dll into my project either.
Thanks
Steve
delete the retained line from the VBP file. it is a compilation option in VB6.
ASKER
glass cookie
this code works but I would like it to show the send mail form from outlook so the user can select the recipient of the mail message from the global address book.
Thanks
steve
this code works but I would like it to show the send mail form from outlook so the user can select the recipient of the mail message from the global address book.
Thanks
steve
I am appending the above referenced code from freevbcode.com for your quick reference,
========================== ========== ========== ======
The owner of the code is Stanley Campbell and not me.
========================== ========== ========== =======
Public Sub SendOutlookMail(Subject As String, Recipient As _
String, Message As String)
On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object
Set oLapp = CreateObject("Outlook.appl ication")
Set oItem = oLapp.createitem(0)
'
With oItem
.Subject = Subject
.To = Recipient
.body = Message
.Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'
Exit Sub
errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub
==========================
The owner of the code is Stanley Campbell and not me.
==========================
Public Sub SendOutlookMail(Subject As String, Recipient As _
String, Message As String)
On Error GoTo errorHandler
Dim oLapp As Object
Dim oItem As Object
Set oLapp = CreateObject("Outlook.appl
Set oItem = oLapp.createitem(0)
'
With oItem
.Subject = Subject
.To = Recipient
.body = Message
.Send
End With
'
Set oLapp = Nothing
Set oItem = Nothing
'
Exit Sub
errorHandler:
Set oLapp = Nothing
Set oItem = Nothing
Exit Sub
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have acheived a good starting piont with this code.
I know see outlook and have been able to attach the required doc., put in a recp name if I want to ect.
Thanks
I know see outlook and have been able to attach the required doc., put in a recp name if I want to ect.
Thanks