R
robboll
Hello! The routine below works great when I send only one email. But
when sending another email, I have to kill Outlook via Task Manager
where it
is immediately replaced by another session of Outlook and Outlooks
again
comes up.
Any help or suggestions appreciated!
Rbollinger
=========================================================
Sub Send SendEmail()
On Error GoTo Err_Command11_Click
Dim stDocName, mTO, mCC, mSubject As String
stDocName = "frmSnapShot"
mTO = Forms!frmEmail!emailTO
mCC = Forms!frmEmail!emailCC
mSubject = Forms!frmEmail!Subject
mpath = Mid(Forms!frmIssues!FolderPath, InStr(1, Nz(Forms!
frmIssues!FolderPath), "#") + 1, 100)
DoCmd.SendObject acReport, stDocName, , mTO, mCC, , mSubject, IIf
(Forms!frmEmail!Check3 = -1, "Shared Directory:" & vbCrLf & mpath,
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: "
& Err.Description
Resume Error_out
Error_out:
End Sub
when sending another email, I have to kill Outlook via Task Manager
where it
is immediately replaced by another session of Outlook and Outlooks
again
comes up.
Any help or suggestions appreciated!
Rbollinger
=========================================================
Sub Send SendEmail()
On Error GoTo Err_Command11_Click
Dim stDocName, mTO, mCC, mSubject As String
stDocName = "frmSnapShot"
mTO = Forms!frmEmail!emailTO
mCC = Forms!frmEmail!emailCC
mSubject = Forms!frmEmail!Subject
mpath = Mid(Forms!frmIssues!FolderPath, InStr(1, Nz(Forms!
frmIssues!FolderPath), "#") + 1, 100)
DoCmd.SendObject acReport, stDocName, , mTO, mCC, , mSubject, IIf
(Forms!frmEmail!Check3 = -1, "Shared Directory:" & vbCrLf & mpath,
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: "
& Err.Description
Resume Error_out
Error_out:
End Sub