Option Compare Database
Public Sub Command28_Click()
Call SendEmail
End Sub
Sub SendEmail()
Dim objMsg As MailItem
Set objMsg = Outlook.CreateItem(olMailItem)
If (Forms("Entry_Log_Form")![Project_Name]) = "RESERVES" Then
With objMsg
.To = "name@company.com"
.CC = "name@company.com; name@company.com"
.Subject = "Ticket: " & (Forms("Entry_Log_Form")![Ticket_Number]) & " - Project Name: " & (Forms("Entry_Log_Form")![Project_Name])
.Categories = "PROJECTS"
.BodyFormat = olFormatPlain ' send plain text message
.HTMLBody = "Greetings" & "<br />" & "<br />" & " Ticket " & (Forms("Entry_Log_Form")![Ticket_Number]) & " was completed successfully." & "<br />" & "<br />" & "<U>" & "TOTALS" & "</U>" & "<br />" & "<br />" & " " & "Total Items Original File: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Items: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Fields: " & (Forms("Entry_Log_Form")![Number_of_Fields]) & "<br />" & "<br />" & "<U>" & "PROCESSED" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & "<U>" & "QUALITY ASSURANCE" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & " Thank You" & "<br />"
.Display
End With
End If
If (Forms("Entry_Log_Form")![Project_Name]) = "RESERVES_88" Then
With objMsg
.To = "name@company.com"
.CC = "name@company.com; name@company.com"
.Subject = "Ticket: " & (Forms("Entry_Log_Form")![Ticket_Number]) & " - Project Name: " & (Forms("Entry_Log_Form")![Project_Name])
.Categories = "PROJECTS"
.BodyFormat = olFormatPlain ' send plain text message
.HTMLBody = "Greetings" & "<br />" & "<br />" & " Ticket " & (Forms("Entry_Log_Form")![Ticket_Number]) & " was completed successfully." & "<br />" & "<br />" & "<U>" & "TOTALS" & "</U>" & "<br />" & "<br />" & " " & "Total Items Original File: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Items: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Fields: " & (Forms("Entry_Log_Form")![Number_of_Fields]) & "<br />" & "<br />" & "<U>" & "PROCESSED" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & "<U>" & "QUALITY ASSURANCE" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & " Thank You" & "<br />"
.Display
End With
End If
If (Forms("Entry_Log_Form")![Project_Name]) = "NON_ACCRUAL_RESERVES" Then
With objMsg
.To = "name@company.com"
.CC = "name@company.com; name@company.com"
.Subject = "Ticket: " & (Forms("Entry_Log_Form")![Ticket_Number]) & " - Project Name: " & (Forms("Entry_Log_Form")![Project_Name])
.Categories = "PROJECTS"
.BodyFormat = olFormatPlain ' send plain text message
.HTMLBody = "Greetings" & "<br />" & "<br />" & " Ticket " & (Forms("Entry_Log_Form")![Ticket_Number]) & " was completed successfully." & "<br />" & "<br />" & "<U>" & "TOTALS" & "</U>" & "<br />" & "<br />" & " " & "Total Items Original File: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Items: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Fields: " & (Forms("Entry_Log_Form")![Number_of_Fields]) & "<br />" & "<br />" & "<U>" & "PROCESSED" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & "<U>" & "QUALITY ASSURANCE" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & " Thank You" & "<br />"
.Display
End With
End If
If (Forms("Entry_Log_Form")![Requestor_Name]) = "FA_PROCESS" Then
With objMsg
.To = "name@company.com"
.CC = "name@company.com; name@company.com"
.Subject = "Ticket: " & (Forms("Entry_Log_Form")![Ticket_Number]) & " - Project Name: " & (Forms("Entry_Log_Form")![Project_Name])
.Categories = "PROJECTS"
.BodyFormat = olFormatPlain ' send plain text message
.HTMLBody = "Greetings" & "<br />" & "<br />" & " Ticket " & (Forms("Entry_Log_Form")![Ticket_Number]) & " was completed successfully." & "<br />" & "<br />" & "<U>" & "TOTALS" & "</U>" & "<br />" & "<br />" & " " & "Total Items Original File: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Items: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Fields: " & (Forms("Entry_Log_Form")![Number_of_Fields]) & "<br />" & "<br />" & "<U>" & "PROCESSED" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & "<U>" & "QUALITY ASSURANCE" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & " Thank You" & "<br />"
.Display
End With
End If
If (Forms("Entry_Log_Form")![Project_Name]) <> "RESERVES" Or (Forms("Entry_Log_Form")![Project_Name]) <> "RESERVES_88" Or (Forms("Entry_Log_Form")![Project_Name]) <> "NON_ACCRUAL_RESERVES" Or (Forms("Entry_Log_Form")![Project_Name]) <> "FA_PROCESS" Then
With objMsg
.To = (Forms("Entry_Log_Form")![Requestor_Name])
.CC = "Ver.Santos@cit.com; Xavier.Arias@cit.com; Jessie.Schultz@cit.com; Christopher.Liles@cit.com"
.Subject = "Ticket: " & (Forms("Entry_Log_Form")![Ticket_Number]) & " - Project Name: " & (Forms("Entry_Log_Form")![Project_Name])
.Categories = "PROJECTS"
.BodyFormat = olFormatPlain ' send plain text message
.HTMLBody = "Greetings" & "<br />" & "<br />" & " Ticket " & (Forms("Entry_Log_Form")![Ticket_Number]) & " was completed successfully." & "<br />" & "<br />" & "<U>" & "TOTALS" & "</U>" & "<br />" & "<br />" & " " & "Total Items Original File: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Items: " & (Forms("Entry_Log_Form")![Number_of_Items]) & "<br />" & " " & "Total Worked Fields: " & (Forms("Entry_Log_Form")![Number_of_Fields]) & "<br />" & "<br />" & "<U>" & "PROCESSED" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & "<U>" & "QUALITY ASSURANCE" & "</U>" & "<br />" & "<br />" & " " & (Forms("Entry_Log_Form")![Number_of_Fields]) & " Fields" & "<br />" & "<br />" & " Thank You" & "<br />"
.Display
End With
End If
Set objMsg = Nothing
End Sub