Prevent dialog - Prevents Sending Excel File From Outlook

  • Thread starter Thread starter JP
  • Start date Start date
J

JP

Hi,

I've read that:

"Outlook prevents e-mail messages from being sent
programmatically from
Outlook without your knowledge by displaying a dialog that
enables you to send or not
send the message."

I want to disable this protection...


I have attempted to install outlook redemption from:

http://www.dimastr.com/redemption


I installed the file and now it is in

C:\Program Files\Redemption\Redemption.dll


Then I have gone to excel and:

1: Go to the VBA editor, Alt -F11
2: Tools>References in the Menu bar
3: Place a Checkmark before Microsoft Office Outlook 9.0
Object Library


Then I have put in the following code:

Sub safe_send_mail

dim SafeItem, oItem
set SafeItem = CreateObject
("Redemption.SafeMailItem") 'Create an instance of
Redemption.SafeMailItem
set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "(e-mail address removed)"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send

End Sub


But I get the following error;

Object doesn't support this property or method (Error 438)


Please tell me what I am doing wrong! Any suggestions
would be great.

Thanks.
 
Hi

I'm using Microsoft Outlook

from Microsoft Office 2000 SR - 1 Profesional

When I run the sub my workbook gets saved as:

send mail test.xls 15-08-03 16-24-56

in my C:/

So that works but I never recive the Email and I don't
think it is sent.

Thanks again for you help

JP
 
Hi JP

Maybe it is because you do not have a full install.?????
I will soon delete the beta 11 from my computer and will install Win 2000 on that part
to see if I can find it.
 
Hi Ron de Bruin,

I will have to double check with my IT department on
Monday about the instal. Thanks again for all your help.

JP
 
This work perfect with windows 2000 for me. With the
Redemption dll installed.

Found this on Googles a while back.

Private Sub Safemail()
Dim SafeItem, oItem, objOL, Namespace
Set objOL = CreateObject("Outlook.Application")
Set Namespace = objOL.GetNamespace("MAPI")
Namespace.Logon
Set SafeItem = CreateObject
("Redemption.SafeMailItem") 'Create an instance of
Redemption.SafeMailItem
Set oItem = objOL.CreateItem(0) 'Create a new message
oItem.Save
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "Kurt Doe"
SafeItem.Recipients.Add "Brad Doe"
SafeItem.Recipients.Add "Kevin Doe"
SafeItem.Recipients.Add "Ross Doe"
SafeItem.Recipients.ResolveAll
SafeItem.Attachments.Add "G:\P&FM\PARTS\Trash\inlet.xls"
SafeItem.Subject = "Stock Order"
SafeItem.Body = "Thanks People"
SafeItem.Send
Set objOL = Nothing
Set oItem = Nothing
End Sub
 
Thanks! This code works great! How do I attach the
workbook that the code is in? When I use:

SafeItem.Attachments.Add ActiveWorkbook.FullName

I get the error message:

Cannot open file

But when I specify a path to another workbook it works
flawlessly.

Thanks again.

JP
 
Figured it out - used one of Rons' codes.
-----Original Message-----
Thanks! This code works great! How do I attach the
workbook that the code is in? When I use:

SafeItem.Attachments.Add ActiveWorkbook.FullName

I get the error message:

Cannot open file

But when I specify a path to another workbook it works
flawlessly.

Thanks again.

JP


.
 
Back
Top