|
-
September 12th, 2001, 11:12 AM
#1
How do I attach a file to email?
Hi,
I'm trying to automate attaching an excel document to Outlook email. I've seen quite a few suggestions but cant seem to attach the document. I have included my code below.
Could someone please help me?
THANKS in advance, Christa
P
rivate Sub CommandButton_Click()
'ActiveWorkbook.SaveAs "C:\testsurvey.xls"
Dim email
Set email = CreateObject("Outlook.Application")
With email.CreateItem(olMailItem)
.to = "[email protected]"
.CC = " "
.BCC = " "
.Subject = "Customer Satisfaction Survey "
.Body = "Attached you will find the Customer Satisfaction Survey."
.Attachment.Add = "C:\testsurvey.xls"
.Display
'.Send
End With
MsgBox "Survey sent! Thank you!", , "Send Message"
Set email = Nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|