C
CAM
Hello,
I am trying to figure out what is wrong with my code (see below). When I
press the email button I get two New message from outlook. The first show
the actual email message and then a second new message appearing, but is
blank. What am I doing wrong. I should only get the e-mail with message
displaying not a blank. Thank you in advance.
Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
'email notification response
Dim email As String
Dim ref As String
Dim EmailNotification As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
email = GroupMemberEmail
EmailNotification = Notification
ref = "Update Master Project Database"
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
..To = email
..Subject = ref
..body = EmailNotification
..Display
End With
Exit_cmdEmail_Click:
Exit Sub
Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click
End Sub
I am trying to figure out what is wrong with my code (see below). When I
press the email button I get two New message from outlook. The first show
the actual email message and then a second new message appearing, but is
blank. What am I doing wrong. I should only get the e-mail with message
displaying not a blank. Thank you in advance.
Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click
'email notification response
Dim email As String
Dim ref As String
Dim EmailNotification As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
email = GroupMemberEmail
EmailNotification = Notification
ref = "Update Master Project Database"
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
..To = email
..Subject = ref
..body = EmailNotification
..Display
End With
Exit_cmdEmail_Click:
Exit Sub
Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click
End Sub