Emailing a file attachment

  • Thread starter Thread starter Ron Bowser
  • Start date Start date
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)
 
Ron - I got the same problem - please let me know if/when you get an
answer..
Jim McDonald
 
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
 
Back
Top