LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Add attachment to an already open Outlook email

Hi,

I'm trying to use Excel to add an attachment to an Outlook email
that's already been opened in Outlook. I have code that creates a new
email and adds the attachment, but I want to be able to preserve the
email chain in a reply or add the file after I've already written the
body of the email.

Any help is appreciated! Thanks! Here's the code I mentioned that I
already have:

Sub test()
Dim filename As String
Dim result As Long
Dim OutMail As Object
Dim OutApp As Object

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0) ' this is the line
I expect needs to be changed.


With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Emailing: " & ActiveWorkbook.Name
.Body = ""
.Attachments.Add Environ("temp") & "\zip\" &
Mid(ActiveWorkbook.Name, 1, Len(ActiveWorkbook.Name) - 4) & ".zip"
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 
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
Email a file as an attachment in Outlook 2000 using Excel VB macro Freddy Excel Programming 11 July 11th 07 04:54 PM
Send an email attachment (pdf file) from Excel 2003 using Outlook Express [email protected] Excel Programming 6 November 16th 06 03:02 PM
Excel Spreadsheet email attachment unable to open in Outlook Expr. Joanne from Tiffin, Oh Excel Discussion (Misc queries) 1 April 23rd 05 12:21 AM
email shortcut to active workbook as an outlook attachment Neil Deinhardt Excel Programming 0 September 28th 04 08:14 PM
Email Attachment from Excel using Outlook. Pyball[_3_] Excel Programming 2 December 17th 03 07:08 PM


All times are GMT +1. The time now is 07:05 AM.

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

About Us

"It's about Microsoft Excel"