Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default 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
__________________________
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default 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










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default 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




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
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Macro to send a mail to outlook [email protected] Excel Discussion (Misc queries) 1 August 24th 06 12:48 PM
loop trough e-mail address list to send task lists with outlook Paul. Excel Discussion (Misc queries) 2 April 14th 05 11:48 AM
Send to Outlook 2000 not Outlook Express Jimbo Excel Discussion (Misc queries) 2 January 4th 05 08:19 PM
Send mail from vba with the outlook distribution list eli Excel Programming 0 January 2nd 04 10:21 PM


All times are GMT +1. The time now is 12:48 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"