ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help for Send Mail via Outlook (https://www.excelbanter.com/excel-programming/335929-help-send-mail-via-outlook.html)

new.microsoft.com

Help for Send Mail via Outlook
 
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



Nigel

Help for Send Mail via Outlook
 
You cannot! but you can use another method see Ron de Bruin site.....

http://www.rondebruin.nl/mail/prevent.htm

--
Cheers
Nigel



"new.microsoft.com" wrote in message
...
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





Richard Buttrey

Help for Send Mail via Outlook
 
On Sat, 30 Jul 2005 10:13:17 +0800, "new.microsoft.com"
wrote:

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
__________________________

new.microsoft.com

Help for Send Mail via Outlook
 
How can I use the outlook express to send mail rather than use outlook?

"Nigel" wrote in message
...
You cannot! but you can use another method see Ron de Bruin site.....

http://www.rondebruin.nl/mail/prevent.htm

--
Cheers
Nigel



"new.microsoft.com" wrote in message
...
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







David McRitchie

Help for Send Mail via Outlook
 
Should be the same, after all a web page doesn't know
what email program you have for your default.

The other question about sending automatically is

ActiveWorkbook.FollowHyperlink (Olmail)
Application.Wait (Now + TimeValue("0:00:03"))
Application.SendKeys "%s"

--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"new.microsoft.com" wrote in message ...
How can I use the outlook express to send mail rather than use outlook?

"Nigel" wrote in message
...
You cannot! but you can use another method see Ron de Bruin site.....

http://www.rondebruin.nl/mail/prevent.htm

--
Cheers
Nigel



"new.microsoft.com" wrote in message
...
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









David McRitchie

Help for Send Mail via Outlook
 
sorry hadn't looked carefully enough not familiar with Outlook
mail and thought you had created a string as it were a hyperlink






All times are GMT +1. The time now is 11:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com