Emailing a file attachment

R

Ron Bowser

I understand the SendObject method does not support sending an attachment
that is not an Access Object.

So, is there and reasonably easy way to attach a file to an email message?

Is the template file of any help? I tried a simple template and it didn;t
use it.

Ron Bowser
(e-mail address removed)
 
J

Jim McDonald

Ron - I got the same problem - please let me know if/when you get an
answer..
Jim McDonald
 
B

Billy Banter

Me too, I have got some code but it just sends the file without opening up a
new email this is the code I have.

Private Sub Command2_Click()

'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = "(e-mail address removed)"
.Subject = "Look at this sample attachment"
.Body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Documents and Settings\Administrator\My
Documents\hh.CSV"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here




End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top