[AccessD] SendObject Attachments

max.wanadoo at gmail.com max.wanadoo at gmail.com
Fri Nov 23 11:25:55 CST 2007


Hi Rocky,
Try this:


  Dim myolApp As Outlook.Application, myItem As Outlook.MailItem
  Dim strDataFileName As String, strEmailTo As String
  Set myolApp = CreateObject("Outlook.Application")
  Set myItem = myolApp.CreateItem(olMailItem)

  strEmailTo = "Rocky at databaseadvisors.com"
  strDataFileName = "c:\filename.txt"
  myItem.HTMLBody =
fFileContents("c:\Templates\General\ExplainSecureMailings.html")
  myItem.To = strEmailTo
  myItem.Subject = "Data Mailings"
  myItem.Attachments.Add strDataFileName
  myItem.Attachments.Add "c:\file2.txt"
  myItem.Attachments.Add "c:\file3.txt"  
  myItem.Attachments.Add "c:\file4.txt"
  myItem.Send

Max 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Friday, November 23, 2007 4:20 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] SendObject Attachments


 
Dear List:
 
Can you use SendObject to generate an email with two attachments?  If not,
in the absence of being assured that outlook is on every machine (which it
ain't in this case), is there some other simple global method to generate an
email with a couple of attachments?
 
MTIA
 
Rocky
 

 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list