Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Sheet Attachment
Combobox1 is populated with sheet names. The user will
select a sheetname from the combobox. What is the code that will attach the sheet that is in combobox1 and bring up an outlook email dialog box. I want the email dialog box to have the subject of "Stats" and an empty body and To address field. For example, the user clicks the combobox and selects the value "Todd Huttenstine". When the code is run, it must attach worksheet "Todd Huttenstine" to the email. Below is the code I have so far, but I want my email address taken out. When I take it out I get an error. Can anyone please show me the modified code to perform the task? 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 Thank you Todd Huttenstine |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Knowing the creation date of an excel sheet email attachment | Excel Discussion (Misc queries) | |||
Auto sending workbook or sheet as an attachment using Outlook | Excel Discussion (Misc queries) | |||
Email a single sheet as attachment ?? | Excel Discussion (Misc queries) | |||
Emailing Excel Sheet As Attachment | Excel Programming |