E
Eka1618
Hello,
I have recently split my DB and several users are working on a runtime
version of Access 2007. The code I have written to send e-mails eliminated
the message that pops up when you try to send and e-mail without editing it
first: "A program is trying to send an e-mail on your behalf..."
The code only seems to eliminate the message for users who have the full
version of Access 2007. I am wondering if anyone else has had this problem.
Below is a sample of how I am sending e-mails. If anyone knows how to solve
the runtime issue, please let me know. I do not want to use "Click Yes" or
"Redemption" methods.
Thank You!
'***********************************************************
' btnReport_Click - send confirmation that due date has changed.
'***********************************************************
Private Sub btnReport_Click()
'Send an e-mail using the outlook application object...
'version 1.0
'1.0: Initial version.
Dim outOutlookInstance As Outlook.Application
Dim maiMessage As MailItem
Dim lngCounter As Long
Dim strArray() As String
'Dim emName As String, varItem As Variant
Dim emailBody As String
Dim emailSubject As String
On Error GoTo SendEMail_Error
'Create the Outlook instance...
Set outOutlookInstance = CreateObject("Outlook.Application")
emailSubject = "Product Test Request Due Date Changed"
Me.REQUEST_NO.SetFocus
emailBody = "Hello, <br><br>" & _
"The product test request due date for Part Number: " & "<b><font color
= red>" & REQUEST_NO.Text & "</font></b>" & _
" has been changed.<br><br>"
Me.DUE_DATE.SetFocus
emailBody = emailBody & "New due date: " & "<b><font color = red>" &
DUE_DATE.Text & "</font></b><br><br>" & _
"Please reply to this e-mail weather or not this proposed date is
feasible." & "<br><br>" & _
"Thank You!"
'Create the mail message...
Set maiMessage = outOutlookInstance.CreateItem(olMailItem)
With maiMessage
.To = CurrentDb.Properties("RequestorEmail")
.SentOnBehalfOfName = CurrentDb.Properties("RequesteeEmail")
.subject = emailSubject
.HTMLBody = "<h2 align = center><b><font color = red>Product Test
Request Due Date Changed (Test Requestor Next
Action)</font></b></h2><br><br>" & emailBody
'Send the message...
.Send
End With
DoCmd.Close acReport, "rptRequestScreen", acSaveNo
DoCmd.Close acReport, "rptRequestPLK", acSaveNo
DoCmd.OpenForm "frmMain", acNormal, , , , acDialog
DoCmd.Close acForm, "frmDueDate", acSaveNo
'Clear the objects...
Set maiMessage = Nothing
Set outOutlookInstance = Nothing
SendEMail_Error:
If Err.Number <> 0 Then
MsgBox Err.Number & ": " & Err.description, vbCritical, "SendEMail"
End If
End Sub
I have recently split my DB and several users are working on a runtime
version of Access 2007. The code I have written to send e-mails eliminated
the message that pops up when you try to send and e-mail without editing it
first: "A program is trying to send an e-mail on your behalf..."
The code only seems to eliminate the message for users who have the full
version of Access 2007. I am wondering if anyone else has had this problem.
Below is a sample of how I am sending e-mails. If anyone knows how to solve
the runtime issue, please let me know. I do not want to use "Click Yes" or
"Redemption" methods.
Thank You!
'***********************************************************
' btnReport_Click - send confirmation that due date has changed.
'***********************************************************
Private Sub btnReport_Click()
'Send an e-mail using the outlook application object...
'version 1.0
'1.0: Initial version.
Dim outOutlookInstance As Outlook.Application
Dim maiMessage As MailItem
Dim lngCounter As Long
Dim strArray() As String
'Dim emName As String, varItem As Variant
Dim emailBody As String
Dim emailSubject As String
On Error GoTo SendEMail_Error
'Create the Outlook instance...
Set outOutlookInstance = CreateObject("Outlook.Application")
emailSubject = "Product Test Request Due Date Changed"
Me.REQUEST_NO.SetFocus
emailBody = "Hello, <br><br>" & _
"The product test request due date for Part Number: " & "<b><font color
= red>" & REQUEST_NO.Text & "</font></b>" & _
" has been changed.<br><br>"
Me.DUE_DATE.SetFocus
emailBody = emailBody & "New due date: " & "<b><font color = red>" &
DUE_DATE.Text & "</font></b><br><br>" & _
"Please reply to this e-mail weather or not this proposed date is
feasible." & "<br><br>" & _
"Thank You!"
'Create the mail message...
Set maiMessage = outOutlookInstance.CreateItem(olMailItem)
With maiMessage
.To = CurrentDb.Properties("RequestorEmail")
.SentOnBehalfOfName = CurrentDb.Properties("RequesteeEmail")
.subject = emailSubject
.HTMLBody = "<h2 align = center><b><font color = red>Product Test
Request Due Date Changed (Test Requestor Next
Action)</font></b></h2><br><br>" & emailBody
'Send the message...
.Send
End With
DoCmd.Close acReport, "rptRequestScreen", acSaveNo
DoCmd.Close acReport, "rptRequestPLK", acSaveNo
DoCmd.OpenForm "frmMain", acNormal, , , , acDialog
DoCmd.Close acForm, "frmDueDate", acSaveNo
'Clear the objects...
Set maiMessage = Nothing
Set outOutlookInstance = Nothing
SendEMail_Error:
If Err.Number <> 0 Then
MsgBox Err.Number & ": " & Err.description, vbCritical, "SendEMail"
End If
End Sub