PC Review


Reply
Thread Tools Rate Thread

Code for Emailing with attachments from Access

 
 
jon.ingram@comcast.net
Guest
Posts: n/a
 
      25th Feb 2006
I am wondering if anyone out there has some VB code that I can put in
access that will open outlook email attach 2 excel files and address
it to a distribution list I have saved in outlook.

This would be huge....thanks.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIFdpY2tlcmF0aA==?=
Guest
Posts: n/a
 
      25th Feb 2006
Here is an MSDN article that should help you get started. I haven't tried it
out yet, but at first glance it appears to allow only one attached file to be
included as an optional parameter. You should be able to modify this to loop
through a series of attachment paths.

Using Automation in Microsoft Office Access 2003 to Work with Microsoft
Office Outlook 2003
http://msdn.microsoft.com/library/de..._ac_olauto.asp


As for accessing a saved distribution list, I'm afraid you are on your own
there. I'm pretty sure this capability has been denied, because it provides
an open path for virus writers to access e-mail addresses via code.


Tom

http://www.access.qbuilt.com/html/ex...tributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________


"(E-Mail Removed)" wrote:

> I am wondering if anyone out there has some VB code that I can put in
> access that will open outlook email attach 2 excel files and address
> it to a distribution list I have saved in outlook.
>
> This would be huge....thanks.
>
>

 
Reply With Quote
 
Ron2005
Guest
Posts: n/a
 
      27th Feb 2006
Here is an example:

Set o = CreateObject("Outlook.Application")
'Set o = CreateObject("Word.Application")
Set m = o.CreateItem(0)

m.To = "Paul Tucker" ' The distribution list name goes here
m.Subject = "SUPP Analysis Spreadsheet "

m.body = Chr(13) & Chr(13) & _
" Date: " & Date & Chr(13) & " " & _
"SharePoint as of: " & ImportedShare & Chr(13) & " " &
_
"Vendor Stat as of: " & ImportedXLS & Chr(13) & " " & _
"Analysis File: " & exportName & Chr(13) & " " & _
"Exported on: " & exportedXLS & Chr(13) & " " &
_
Chr(13) & _
Chr(13)


m.attachments.Add ReportDir & exportName ' point to the full
address of attachment here

'
There can be multiple of the above

' m.display ' display shows email and
the user has to press send button
m.send ' Send does it
automatically with security from Outlook

Ron

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Emailing from Access 2003 using VBA code via Outlook 2007 errors o Bill Microsoft Access 2 23rd Nov 2008 08:46 PM
Emailing attachments from Access Terry Holland Microsoft Access Form Coding 2 31st Jan 2008 11:30 PM
eMailing PDF files as attachments from Access Piri Microsoft Access Form Coding 4 4th Nov 2007 03:24 AM
Emailing from Access and inserting attachments =?Utf-8?B?Umh5cyBEYXZpZXM=?= Microsoft Access VBA Modules 1 29th Jun 2006 08:10 PM
Access/Outlook Security emailing attachments =?Utf-8?B?RGF2ZSBEYXZpcw==?= Microsoft Access VBA Modules 0 13th Mar 2006 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 PM.