Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Attaching files to Outlook

I have an Excel macro that saves a workbook and sends it to a user at a
specific cost center. Part of the code I am using is below.

I have a new requirement that other cost centers would like to attach backup
files to support the Excel file that gets sent in the e-mail.

I'm looking for some code or suggestions that will allow me to attach the
other files to the e-mail before it is sent. I will have the paths to each
backup file in a array.

Is this possible? Thanks for the help

ActiveWorkbook.SaveAs (vPath & vNewFileName)

On Error GoTo errmsg

ActiveWorkbook.SendMail ", "),
Subject:=vNewFileName1 & " !B!A!C!K!U!P!S!"

ActiveWorkbook.Close (False)

MsgBox "Your file has been sent"

Application.StatusBar = "Ready"
Application.DisplayStatusBar = True

--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Attaching files to Outlook

Not possible with SendMail

If you use Outlook you can do it, see this site for the Outlook object model examples
http://www.rondebruin.nl/sendmail.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"JT" wrote in message ...
I have an Excel macro that saves a workbook and sends it to a user at a
specific cost center. Part of the code I am using is below.

I have a new requirement that other cost centers would like to attach backup
files to support the Excel file that gets sent in the e-mail.

I'm looking for some code or suggestions that will allow me to attach the
other files to the e-mail before it is sent. I will have the paths to each
backup file in a array.

Is this possible? Thanks for the help

ActiveWorkbook.SaveAs (vPath & vNewFileName)

On Error GoTo errmsg

ActiveWorkbook.SendMail ", "),
Subject:=vNewFileName1 & " !B!A!C!K!U!P!S!"

ActiveWorkbook.Close (False)

MsgBox "Your file has been sent"

Application.StatusBar = "Ready"
Application.DisplayStatusBar = True

--
JT

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attaching a Read Receipt to Outlook E-mail DS Excel Programming 2 January 16th 09 03:31 PM
Attaching an Outlook email into a cell Joanne R Excel Discussion (Misc queries) 0 December 15th 08 11:17 PM
Attaching Emails in Outlook Message Format Marie FP[_2_] Excel Discussion (Misc queries) 1 June 23rd 08 07:01 PM
Attaching an Outlook Library programatically Richard Buttrey Excel Programming 3 August 4th 05 10:47 AM
Trouble attaching an Excel file in Outlook 2003 - Help Lionel Excel Discussion (Misc queries) 1 April 9th 05 09:03 PM


All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"