How to Disable Prompts

  • Thread starter Thread starter Xcelsoft
  • Start date Start date
X

Xcelsoft

I am using Visual Basic to automate sending emails to
customers. Outlooks prompts me each time with the
following:

"A PROGRAM IS TRYING TO ACCESS EMAIL ADDRESSED YOU HAVE
STORED IN OUTLOOK. DO YOU WANT TO ALLOW THIS."

After you answer, it then prompts you with:

"A PROGRAM IS AUTOMATICALLY TRYING TO SEND EMAIL ON YOUR
BEHALF."

Is there a way to turn these off??

Thanks,

Xcelsoft
 
See http://www.outlookcode/d/sec.htm for your options.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I am using Visual Basic to automate sending emails to
customers. Outlooks prompts me each time with the
following:

"A PROGRAM IS TRYING TO ACCESS EMAIL ADDRESSED YOU HAVE
STORED IN OUTLOOK. DO YOU WANT TO ALLOW THIS."

After you answer, it then prompts you with:

"A PROGRAM IS AUTOMATICALLY TRYING TO SEND EMAIL ON YOUR
BEHALF."

Is there a way to turn these off??

Thanks,

Xcelsoft
 
Thanks Sue,

I installed Redemption and ran the following from the run
command in Windows:

regsvr32.exe "c:\program files\redemption\redemption.dll"

I assume there's nothing else to do here.

My code is as follows:

With objOutlookMsg
..Save
Dim objSafeMail
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objOutlookMsg
objSafeMail.Send


QUESTION:

1.) How do you declare the objSafeMail variable???
Dim objSafeMail As ???????

This code will eliminate the prompt about "A program is
automatically trying to send email on your behalf" but
Outlook still prompts for the message "A program is
trying to access Email addresses you have stored in
Outlook. Do you want to allow this."

Also, it puts the message in the Drafts Box instead of
Sending it.

Any help will be appreciated.

Thanks
 
You can declare it as Redemption.SafeMailItem or as Object.

What statement produces the prompt?

The Drafts issue is a known issue you can read about on the Redemption web
site. It does not hinder the sending of the message.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers




Thanks Sue,

I installed Redemption and ran the following from the run
command in Windows:

regsvr32.exe "c:\program files\redemption\redemption.dll"

I assume there's nothing else to do here.

My code is as follows:

With objOutlookMsg
..Save
Dim objSafeMail
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objOutlookMsg
objSafeMail.Send


QUESTION:

1.) How do you declare the objSafeMail variable???
Dim objSafeMail As ???????

This code will eliminate the prompt about "A program is
automatically trying to send email on your behalf" but
Outlook still prompts for the message "A program is
trying to access Email addresses you have stored in
Outlook. Do you want to allow this."

Also, it puts the message in the Drafts Box instead of
Sending it.

Any help will be appreciated.

Thanks
 
Sue/Dmitry,

Sorry for the double post on the subject.

I am using M/S KB# 209948 to create the emails and
Redemption's code to send it. I think there is something
in the add recipients routine that causes the first
prompt to appear "A program is trying to access email
addresses you have stored in Outlook". I can't seem to
find it.


Sub SendMessage(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Nancy
Davolio")
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Andrew
Fuller")
objOutlookRecip.Type = olCC

' Set the Subject, Body, and Importance of the
message.
.Subject = "This is an Automation test with
Microsoft Outlook"
.Body = "Last test - I promise." & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add
(AttachmentPath)
End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send

End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub


Any help will be appreciated.

Thanks,

Xcelsoft
 
MailItem.Recipients.Add (and every other Recipient/Recipients statement you
have aftger that) will always trigger the prompt. You need to work with
recipients solely in your Redemption SafeMailItem object:

objOutlookMsg.Save
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
objSafeMail.Item = objOutlookMsg
' do stuff with objSafeMail.Recipients
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Sue/Dmitry,

Sorry for the double post on the subject.

I am using M/S KB# 209948 to create the emails and
Redemption's code to send it. I think there is something
in the add recipients routine that causes the first
prompt to appear "A program is trying to access email
addresses you have stored in Outlook". I can't seem to
find it.


Sub SendMessage(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Nancy
Davolio")
objOutlookRecip.Type = olTo

' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Andrew
Fuller")
objOutlookRecip.Type = olCC

' Set the Subject, Body, and Importance of the
message.
.Subject = "This is an Automation test with
Microsoft Outlook"
.Body = "Last test - I promise." & vbCrLf & vbCrLf
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add
(AttachmentPath)
End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next
.Send

End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub


Any help will be appreciated.

Thanks,

Xcelsoft
 
Back
Top