T
Todd Huttenstine
When I run this code I am getting the error Run-Time error
on this part of the code... "objAttachmt.Source =
ComboBox1.Value"
Below is the entire code.
Please help.
Thanx
Private Sub CommandButton4_Click()
If CheckBox2.Value = True And ComboBox1.Value = "Please
Select Agent to Email" Then
MsgBox "Input Error!" & vbCrLf & "You Must Select
an Agent", vbCritical, "Input Error"
Exit Sub
Else
Dim objSession As Object, objMessage As Object,
objOneRecip As Object
Dim objAttachmt As Object
Set objSession = CreateObject("MAPI.Session")
objSession.Logon
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Stats"
objMessage.Text = ""
Set objAttachmt = objMessage.Attachments.Add
objAttachmt.Source = ComboBox1.Value
'objAttachmt.Source = ("C:\Sheets.xls")
'Set objOneRecip = objMessage.Recipients.Add
'objOneRecip.Name = "(e-mail address removed)"
'objOneRecip.Type = 1
'objOneRecip.Resolve
objMessage.Send showDialog:=True
objSession.Logoff
End If
MsgBox "done"
Exit Sub
If CheckBox1.Value = True Then
MsgBox "insert code2 here"
Else
End If
End Sub
on this part of the code... "objAttachmt.Source =
ComboBox1.Value"
Below is the entire code.
Please help.
Thanx
Private Sub CommandButton4_Click()
If CheckBox2.Value = True And ComboBox1.Value = "Please
Select Agent to Email" Then
MsgBox "Input Error!" & vbCrLf & "You Must Select
an Agent", vbCritical, "Input Error"
Exit Sub
Else
Dim objSession As Object, objMessage As Object,
objOneRecip As Object
Dim objAttachmt As Object
Set objSession = CreateObject("MAPI.Session")
objSession.Logon
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Stats"
objMessage.Text = ""
Set objAttachmt = objMessage.Attachments.Add
objAttachmt.Source = ComboBox1.Value
'objAttachmt.Source = ("C:\Sheets.xls")
'Set objOneRecip = objMessage.Recipients.Add
'objOneRecip.Name = "(e-mail address removed)"
'objOneRecip.Type = 1
'objOneRecip.Resolve
objMessage.Send showDialog:=True
objSession.Logoff
End If
MsgBox "done"
Exit Sub
If CheckBox1.Value = True Then
MsgBox "insert code2 here"
Else
End If
End Sub