Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Emailing using code

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Emailing using code

Here is the basic code:

Sub SendMyMail()

Dim msgTo As String

Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

msgTo = InputBox("Please enter e-mail address", "Address")

With MailOutLook
.To = msgTo
.CC = ""
.BCC = ""
.Subject = ""
.Body = Location
'.Attachments.Add "C:\Path\File.here"
.Send
End With

MsgBox "Message sent to " & msgTo, vbOKOnly

End Sub

If you want to add an attachement, un-comment the .Attachements.Add line and
add the proper path.

Post back with questions!



--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Emailing using code

Yes, I have this code and am using it.
My question is, how do I stop the message from coming up that says;
A program is attempting to send an email on your behalf. Do you wish to
continue.

How do I stop this message from coming up and just seamlessly send the email
when the code is invoked?
--
Stephen


"PJFry" wrote:

Here is the basic code:

Sub SendMyMail()

Dim msgTo As String

Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

msgTo = InputBox("Please enter e-mail address", "Address")

With MailOutLook
.To = msgTo
.CC = ""
.BCC = ""
.Subject = ""
.Body = Location
'.Attachments.Add "C:\Path\File.here"
.Send
End With

MsgBox "Message sent to " & msgTo, vbOKOnly

End Sub

If you want to add an attachement, un-comment the .Attachements.Add line and
add the proper path.

Post back with questions!



--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Emailing using code

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Stephen sjw_ost" wrote in message
...
Yes, I have this code and am using it.
My question is, how do I stop the message from coming up that says;
A program is attempting to send an email on your behalf. Do you wish to
continue.

How do I stop this message from coming up and just seamlessly send the email
when the code is invoked?
--
Stephen


"PJFry" wrote:

Here is the basic code:

Sub SendMyMail()

Dim msgTo As String

Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

msgTo = InputBox("Please enter e-mail address", "Address")

With MailOutLook
.To = msgTo
.CC = ""
.BCC = ""
.Subject = ""
.Body = Location
'.Attachments.Add "C:\Path\File.here"
.Send
End With

MsgBox "Message sent to " & msgTo, vbOKOnly

End Sub

If you want to add an attachement, un-comment the .Attachements.Add line and
add the proper path.

Post back with questions!



--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Emailing using code

Odd. The reason I use that code is because it stops the pop-up from coming
up. I see that someone posted a link. My network must have that
configuration.
--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

Yes, I have this code and am using it.
My question is, how do I stop the message from coming up that says;
A program is attempting to send an email on your behalf. Do you wish to
continue.

How do I stop this message from coming up and just seamlessly send the email
when the code is invoked?
--
Stephen


"PJFry" wrote:

Here is the basic code:

Sub SendMyMail()

Dim msgTo As String

Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

msgTo = InputBox("Please enter e-mail address", "Address")

With MailOutLook
.To = msgTo
.CC = ""
.BCC = ""
.Subject = ""
.Body = Location
'.Attachments.Add "C:\Path\File.here"
.Send
End With

MsgBox "Message sent to " & msgTo, vbOKOnly

End Sub

If you want to add an attachement, un-comment the .Attachements.Add line and
add the proper path.

Post back with questions!



--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Emailing using code

Maybe you use 2007 ?


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"PJFry" wrote in message ...
Odd. The reason I use that code is because it stops the pop-up from coming
up. I see that someone posted a link. My network must have that
configuration.
--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

Yes, I have this code and am using it.
My question is, how do I stop the message from coming up that says;
A program is attempting to send an email on your behalf. Do you wish to
continue.

How do I stop this message from coming up and just seamlessly send the email
when the code is invoked?
--
Stephen


"PJFry" wrote:

Here is the basic code:

Sub SendMyMail()

Dim msgTo As String

Set appOutlook = CreateObject("Outlook.Application")
Set MailOutLook = appOutlook.CreateItem(olMailItem)

msgTo = InputBox("Please enter e-mail address", "Address")

With MailOutLook
.To = msgTo
.CC = ""
.BCC = ""
.Subject = ""
.Body = Location
'.Attachments.Add "C:\Path\File.here"
.Send
End With

MsgBox "Message sent to " & msgTo, vbOKOnly

End Sub

If you want to add an attachement, un-comment the .Attachements.Add line and
add the proper path.

Post back with questions!



--
Regards,

PJ
Please rate this post using the vote buttons if it was helpful.



"Stephen sjw_ost" wrote:

I am using code to email my worksheet. Everytime I run the code I get a
message that says;
A program is trying to send an email on your behalf. Do you wish to continue?

Of course I want to continue because I am sending the email intentionally.
How can I stop this message from coming up and just have my Outlook email
send?
Is this an Outlook security setting or can I bypass this message using VBA?

Thanks for any help
--
Stephen

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
Remove code from a worksheet before emailing LesG Excel Programming 11 September 21st 09 08:45 AM
remove vba code before emailing as attachment pswanie Excel Programming 1 March 12th 08 10:37 PM
Emailing Worksheet with VBA Code David Excel Programming 6 August 23rd 06 01:38 PM
Need help with Emailing Code Please [email protected] New Users to Excel 5 May 29th 06 01:56 AM
Emailing Sheets Code Edit Todd Huttenstine[_2_] Excel Programming 2 November 17th 03 07:46 PM


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