Help for Send Mail via Outlook

  • Thread starter Thread starter new.microsoft.com
  • Start date Start date
N

new.microsoft.com

I use a VBA code as following to send email in Excel, but every time the
Outlook require me to confirm Yes/No to send out mail. How can I disable
that confirmation step?

Thanks


Sub SendWithAtt()

Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurrFile As String


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


ActiveWorkbook.Save

' CurrFile = ActiveWorkbook.path & "\" & ActiveWorkbook.Name
CurrFile = ActiveWorkbook.path & "\" & "OSAllowRates.pdf"
With olMail
.To = ""
'.CC = ""
.Subject = "Testing"
.Body = "Hello"
.Body = ActiveSheet.Range("D4").Text & vbCrLf
.Attachments.Add CurrFile
.Send '.Display '
'.BodyFormat
End With

Set olMail = Nothing
Set olApp = Nothing

End Sub
 
I use a VBA code as following to send email in Excel, but every time the
Outlook require me to confirm Yes/No to send out mail. How can I disable
that confirmation step?

Thanks

I had the same - frustrating problem, and the discovered the small
"ClickYes" bit of software - see

http://www.contextmagic.com/express-clickyes/

You still get the delay of 5 seconds whilst Outlook waits for an
answer, but then this utility 'presses' the OK key for you.

Rgds

__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
 
sorry hadn't looked carefully enough not familiar with Outlook
mail and thought you had created a string as it were a hyperlink
 
Back
Top