ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Crappy message when using the "recipients" property (https://www.excelbanter.com/excel-programming/330853-crappy-message-when-using-recipients-property.html)

Damien McBain[_2_]

Crappy message when using the "recipients" property
 
My excel VBA sends some files it's just created to a number of e-mail
addresses specified in one of the worksheets.

I understand why outlook warns before sending the mail from excel and other
applications, but can I stop the other message re trying to access addresses
from my adress book? The address book doen't really come into play, I have
addresses in the lists. I'm using exchange (not SMTP) so I don't think I can
use CDO.

Here's the code fwiw:

Sub EmailOutOps()
Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object
Dim objNameSpace As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
objNameSpace.Logon , , True

Set objMailItem = objOutlook.CreateItem(0)

'reference the "email" worksheet to get recipient names
For Each c In Range("emailops")
If c.Text < "" Then
objMailItem.Recipients.Add (c.Text)
Else
Exit For
End If
Next c

'set the other mail criteria
objMailItem.Subject = "Haulage for " & Range("date")
objMailItem.Body = "File attached"
objMailItem.Attachments.Add ("I:\Accounting\Daily Tonnes\DailyReports\" &
Range("date") & "-ops.xls")
objMailItem.Send

Set objOutlook = Nothing
Set objNameSpace = Nothing
Set objMailItem = Nothing

End Sub




fastmonkey512[_2_]

Crappy message when using the "recipients" property
 

I've had the same problem, using outlook 2000 on an Exchange server.

I found a nice little freeware util called "Express Click yes" whic
automatically clicks yes for you.

you can download it here . .
http://www.contextmagic.com/express-clickyes

--
fastmonkey51
-----------------------------------------------------------------------
fastmonkey512's Profile: http://www.excelforum.com/member.php...fo&userid=2398
View this thread: http://www.excelforum.com/showthread.php?threadid=37628


Damien McBain[_2_]

Crappy message when using the "recipients" property
 
"fastmonkey512"
wrote in message
news:fastmonkey512.1q22yf_1117811115.4818@excelfor um-nospam.com...

I've had the same problem, using outlook 2000 on an Exchange server.

I found a nice little freeware util called "Express Click yes" which
automatically clicks yes for you.

you can download it here . . .
http://www.contextmagic.com/express-clickyes/


That helps, thanks dude.

There's obviouly no Outlook (2003) setting that I can adjust to get rid of
this security feature (grrrr) if someone has gone to the trouble of writing
this little proggy.

I don't mind the "sonething is trying to send mail as you" message, but the
address book (which pops up for every recipient I add) one is irrelevant
since I specify email adresses.

once again, cheers,

Damo



Nathan Strom

Crappy message when using the "recipients" property
 
"Damien McBain" wrote in message ...
My excel VBA sends some files it's just created to a number of e-mail
addresses specified in one of the worksheets.

I understand why outlook warns before sending the mail from excel and other
applications, but can I stop the other message re trying to access addresses
from my adress book? The address book doen't really come into play, I have
addresses in the lists. I'm using exchange (not SMTP) so I don't think I can
use CDO.


Please see: http://www.slipstick.com/outlook/esecup.htm#autosec

In short, there's no way to do it with VBA or Excel alone.

If all your users are on Exchange, you can use the administrative
options to disable the prompts; see:
http://www.slipstick.com/outlook/esecup/admin.htm.

Your other option is Outlook Redemption, a DLL addin which will allow
you to easily modify your code to bypass Outlook's security prompts:
http://www.dimastr.com/redemption/. There's a free version to use if
your code is non-commercial, and it's relatively inexpensive to
license a distributable version for commercial use. I'll recommend
this option, since it's the one I use. :)

Damien McBain[_2_]

Crappy message when using the "recipients" property
 
"Nathan Strom" wrote in message
om...
"Damien McBain" wrote in message
...
My excel VBA sends some files it's just created to a number of e-mail
addresses specified in one of the worksheets.

I understand why outlook warns before sending the mail from excel and
other
applications, but can I stop the other message re trying to access
addresses
from my adress book? The address book doen't really come into play, I
have
addresses in the lists. I'm using exchange (not SMTP) so I don't think I
can
use CDO.


Please see: http://www.slipstick.com/outlook/esecup.htm#autosec

In short, there's no way to do it with VBA or Excel alone.

If all your users are on Exchange, you can use the administrative
options to disable the prompts; see:
http://www.slipstick.com/outlook/esecup/admin.htm.

Your other option is Outlook Redemption, a DLL addin which will allow
you to easily modify your code to bypass Outlook's security prompts:
http://www.dimastr.com/redemption/. There's a free version to use if
your code is non-commercial, and it's relatively inexpensive to
license a distributable version for commercial use. I'll recommend
this option, since it's the one I use. :)


Set Redemption = very nice

thanks Nathan

Damo




All times are GMT +1. The time now is 04:26 PM.

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