Henry,
 
This is a routine I wrote in MS Access to send files to a vendor.  I don't know what you're doing.  Hopefully, this will help.
 

Jeff McClain
Controller
Memorial Hospital
1101 Michigan Avenue
Logansport, IN  46947
(574) 753-1732
[EMAIL PROTECTED]

 
Private Sub CREATE_TEXT_FILE_TO_SEND_Click()
 
On Error Resume Next
 
Screen.MousePointer = 0 'hourglass
 
'DoCmd.OpenForm "frmpleasewait", acNormal, , , acFormReadOnly, acDialog
 
'create the imc download file
Dim filepath As String: Dim filepath2 As String
 
filepath = "c:\windows\temp\imcfile.txt"
 
Download_IMC (filepath)
 
'create the  download file
filepath2 = "c:\windows\temp\CAIIfile.txt"
 
Download_CAII (filepath2)
 
'Pause for three seconds
Pause (3)
 
'Create the email messages and attach the files
 

Dim OutlkApp As Outlook.Application
Dim MailMsg As Outlook.MailItem
Dim MailMsg2 As Outlook.MailItem
 
Set OutlkApp = New Outlook.Application
Set MailMsg = OutlkApp.CreateItem(olMailItem)
Set MailMsg2 = OutlkApp.CreateItem(olMailItem)
 
MailMsg.Display
MailMsg2.Display
 
MailMsg.To = "[EMAIL PROTECTED]"
MailMsg2.To = "[EMAIL PROTECTED]"
 
MailMsg.Attachments.Add filepath, olByValue, 1, "File 1"
MailMsg2.Attachments.Add filepath2, olByValue, 1, "File 2"
 
MailMsg.CC = "[EMAIL PROTECTED]"
MailMsg2.CC = "[EMAIL PROTECTED]"
 
MailMsg.Importance = olImportanceHigh
MailMsg2.Importance = olImportanceHigh
 
MailMsg.Subject = "File from Memorial Hospital, Logansport, IN"
MailMsg2.Subject = "File from Memorial Hospital, Logansport, IN"
 
MailMsg.Send
MailMsg2.Send
 
 
 
Screen.MousePointer = 1 'normal
 
Dim strmsg As String
 
strmsg = "Download File sent to ""[EMAIL PROTECTED]"" "
 
MsgBox strmsg, vbOKOnly, " "
 
Set OutlkApp = Nothing
Set MailMsg = Nothing
 
DoCmd.Close acForm, "frmPleaseWait", acSaveNo
 
End Sub


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Monday, August 01, 2005 1:49 PM
To: [email protected]
Subject: [Talk] Using VBA to send email via Outlook

I could spend a whole bunch of time looking around the web to try to find what I need, but I'm hoping someone on the listserv has done this and would be willing to share some code. We are switching from using Lotus Notes ot using Outlook at the end of this month. I need to rewrite all of my scirpts that use email to use the new client. Is anyone out there doing this? If so, would you be willing to share your code?

Henry Taylor
Technical Analyst II
Lutheran Health Network
Ph. (260) 425-3914

Reply via email to