Diana
08-20-2000, 07:53 PM
I create an interface to the database in Access 2000 and I want to add a button to send email using Outlook Express. I tried to use an ActiveX control named Outlook Express Mail Object but I coudn't added in my form. The message was "The OLE server isn't registred. To register the OLE server, reinstall it".
Can anyone help me.
Thanks in advance!
Mike Gurman
08-21-2000, 12:43 AM
It's probably easier to use the 'SendObject' Action (or method) - this will send an email via your default mail client (Outlook Express in your case).
Do you want anything (such as a spreadsheet containing data from your application) attached to the email?
I've got a small demo of how to do emailing from Access that I put together for someone else; if you would like a copy, please email me and I will send it by reply.
Mike
Diana
08-21-2000, 01:28 PM
Hi Mike,
It worked!
Thank you so much for your help!
I appreciate it!
Diana
Cosmos75
05-22-2003, 07:16 AM
In case anyone might find this helpfull as an example, I'm also using a button to email the report as a snapshot file.
Dim stDocName As String
Dim Person As String
Dim PersonFirst As String
Dim ReportType As String
Dim StartWeek As Date
Dim EndWeek As Date
Dim NameReport As String
Dim FileName As String
'Last Name (Second Column in ListBox)
Person = Me.LstPeople.Column(1)
'First Name (First Column in ListBox)
PersonFirst = Me.LstPeople.Column(2)
'Office
Office = Me.LstOffice
'Week Choosen from a ListBox
StartWeek = Me.LstStartWeek
'Week Choosen from a ListBox
EndWeek = Me.LstEndWeek
'Option Frame used to choose Report Type (Person of Office)
If Me.FrameOption = 1 Then
stDocName = "rptProductivityDateRangePerson"
ReportType = "Person"
NameReport = Person & ", " & PersonFirst
Else
stDocName = "rptProductivityDateRangeOffice"
ReportType = "Office"
NameReport = Office
End If
'Used for default message in email
FileName = NameReport & " for the period " & Format(StartWeek, "mm-dd-yyyy") &_
" to " & Format(EndWeek, "mm-dd-yyyy")
'Notify User what report will be sent
MsgBox "Productivity report file will be emailed for " & FileName
DoCmd.SendObject acReport, stDocName, "SnapshotFormat (*.snp)", , , , FileName,_
"Here is the " & ReportType & " productivity report for " & FileName
The only thing is I can't control the name of the file that is being emailed, it is sent with the snapshot named the same as the report names in Access (rpt****).
At least, I haven't found a way.