Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to add attachment
Hi Everybody, I am probably stretching the friendship here but I thought I
would ask anyway. I have created a form in excel 2003 with the submit button to send by email. What I want to know is is it possible to have another button on the form to add an attachment and then hit the submit button and have both the form and attachment sent by email. Thanks in advance for any assistance. Lynda |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to add attachment
On Sep 18, 6:34*am, Lynda wrote:
Hi Everybody, I am probably stretching the friendship here but I thought I would ask anyway. I have created a form in excel 2003 with the submit button to send by email. What I want to know is is it possible to have another button on the form to add an attachment and then hit the submit button and have both the form and attachment sent by email. Thanks in advance for any assistance. Lynda Hi Lynda: You can try playing with this code, I use it for a script to filter data into multiple workbooks and attach them to email messages. Note - you cannot have a signature and provide text for the body of the email programmatically (at least, I have never been successful doing so), it is one or the other. Steven Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .to = "RecipientAddress" .CC = "CarbonCopyAddress" .BCC = "BlindCarbonCopyAddress" .Subject = "Your subject here" .Attachments.Add ActiveWorkbook.FullName 'Attaches active workbook .Display 'Displays the processed email. You can change this to .Send End With On Error GoTo 0 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to add attachment
Thank you Steven, that was what i was looking for.
" wrote: On Sep 18, 6:34 am, Lynda wrote: Hi Everybody, I am probably stretching the friendship here but I thought I would ask anyway. I have created a form in excel 2003 with the submit button to send by email. What I want to know is is it possible to have another button on the form to add an attachment and then hit the submit button and have both the form and attachment sent by email. Thanks in advance for any assistance. Lynda Hi Lynda: You can try playing with this code, I use it for a script to filter data into multiple workbooks and attach them to email messages. Note - you cannot have a signature and provide text for the body of the email programmatically (at least, I have never been successful doing so), it is one or the other. Steven Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .to = "RecipientAddress" .CC = "CarbonCopyAddress" .BCC = "BlindCarbonCopyAddress" .Subject = "Your subject here" .Attachments.Add ActiveWorkbook.FullName 'Attaches active workbook .Display 'Displays the processed email. You can change this to .Send End With On Error GoTo 0 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
remove vba code before emailing as attachment | Excel Programming | |||
email as attachment in code | Excel Programming | |||
VB code to generate an e-mail with an EXCEL attachment, but not se | Excel Programming | |||
CODE FOR CHECK BOXES, AND EXCEL AS ATTACHMENT ! | Excel Programming |