I've updated the code to reduce the script and included the code for the email macro so it can be tested by itself. The macro runs fine except no email is created.
Again, thank you for any advice on this.
Private Sub Email_Click()
End Sub
Private Sub CommandButton1_Click()
If OptionButton1 Then
MsgBox "OptionButton 1 was selected"
Call Email672200 ' Module 2
End If
If OptionButton2 Then
MsgBox "OptionButton 2 was selected"
'Sub Email672200()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "672200"
.CC = "672200 CC"
.BCC = ""
.Subject = "672200 - Escrow Shortage Account"
.HTMLBody = "Hello Everyone"
.Attachments.Add ""
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
'End Sub
End If
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
|