Conditional Sheet Attachment
Tom, that worked. Thank you. Below is the modified code.
Combobox1 contains sheet names. I need for it to look in
Combobox1, and attach that sheet to the email. How would
I do this? For example the value "Todd Huttenstine" is in
combobox1. Therefore I need for it to attach sheet "Todd
Huttenstine" to the email.
Option Explicit
Private Sub CommandButton1_Click()
Dim objSession As Object, objMessage As Object,
objOneRecip As Object
Set objSession = CreateObject("MAPI.Session")
objSession.Logon
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Stats"
objMessage.Text = ""
'Set objOneRecip = objMessage.Recipients.Add
'objOneRecip.Name = "
'objOneRecip.Type = 1
'objOneRecip.Resolve
objMessage.Send showDialog:=True
objSession.Logoff
End Sub
|