Macro to delete attachment before E-mail is sent --- see inside

  • Thread starter Thread starter NO One
  • Start date Start date
N

NO One

This macro saves the file, then opens Outlook to mail. It puts the
names in the TO: field (arg1) and the file/location name in the
Subject (arg2). However it still attaches the file. I don't want the
file attached. I'll change the Subject (arg2) to be a text message
but I want the text are to say, "Please click on this link (insert
file location here)" to view my request that needs your approval.

How do I keep the file from being attached?



Sub Approved()
' This macro will send the file to the Facilities and Accounting

On Error Resume Next

ActiveWorkbook.SaveAs Filename:="d:\downloads\" & Range("M14").Value &
".xls"
Application.Dialogs(xlDialogSendMail).Show _
arg1:="(e-mail address removed) ; " & "(e-mail address removed)", _
arg2:="d:\downloads\" & Range("M14").Value & ".xls"

On Error GoTo 0
End Sub
 
If you use Outlook code then you can use this
Example posted by Dick Kusleika

Sub SendLink()
Dim olApp As Outlook.Application
Dim olMi As Outlook.MailItem

Set olApp = New Outlook.Application
Set olMi = olApp.CreateItem(olMailItem)

With olMi
.To = "(e-mail address removed)"
.Subject = "Click this link"
.HTMLBody = "<a href=""http://www.dicks-blog.com"">TRACK</a>"
.Send
End With

Set olMi = Nothing
Set olApp = Nothing

End Sub
 
Back
Top