SendMail disable question?

B

Bret

Im using the SendMail code (shown below) in my VBA program to send Excel
workbooks. The code (provided by this board) works great except for the
fact that Outlook has the dialog box that says "A program is trying to
automatically send an email on your behalf? Do you want to allow this?"
Normally this isn't a problem, however my program is looping thru a
spreadsheet of about 500 names and email addresses so of course this is
cumbersome.
Can this feature be disabled from within Excel or from Outlook?

Sheets(Array("Sheet1", "Sheet2")).Copy
'ActiveWindow.SelectedSheets.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Documents and Settings\"
.SendMail "email address here", _
"comment here"
.ChangeFileAccess xlReadOnly
'Kill .FullName
.Close False
End With

much thanks.
 
B

Bret

Ron,
first thank you for your site and support. You've been a great resource to
me as an Excel VBA developer over the past years, much much appreciated.
the CDO works fine though I need to find out my SMTP server, thats my only
hold up. thanks again.
 
B

Bret

thanks for Randy's vb.net source. For the life of me I cant narrow down on
this site disabling Outlook Security per my needs, sorry to bother Ron but
can you assist please. thanks again.
 
B

Bret

Actually great news, your CDO code worked great as all my test emails went
thru but were delivered this morning from yesterday. Any idea why such a
delay in delivery? Otherwise we're happy as is with this code since it
bypassed the Outlook Security. thank you again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top