View Single Post
  #3  
Old September 27th 06, 09:32 PM posted to microsoft.public.outlook.program_vba
Biguana
external usenet poster
 
Posts: 6
Default "Do you want to allow this" messages driving me mad! Tried Clickyes and Redemption

Hi Ken,

Thanks for the reply. The weird thing is that the items sit in drafts
italicised (as I mentioned), as if they're ready to go, but the only
way I can induce them to do so is by going into each one and sending
separately (defeating the object). Also, is the lack of line breaks
usual with redemption?

Some code is below. The utils.DeliverNow seems to execute a
Send&Receive OK (judging by the pause), but to no avail.

Thanks for your time.

Tim


Sub Sendmails(intAddressCount As Integer, oOutlookApp As
Outlook.Application)

Dim i As Integer
Dim oItem As Outlook.MailItem
Dim rItem As Redemption.SafeMailItem
Dim utils As Object


On Error GoTo ErrHandle

For i = 1 To intAddressCount
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
Set rItem = CreateObject("Redemption.SafeMailItem")

With oItem
'Set the recipient for the new email
.To = Replace(Sheet2.Cells(i, 1).Value, """", "")
'Set the subject
.Subject = Sheet1.Cells(1, 2).Value
.Body = Sheet1.Cells(2, 2).Value & vbCrLf & vbCrLf
& Sheet1.Cells(3, 2).Value
rItem.Item = oItem
rItem.Send
Set utils = CreateObject("Redemption.MAPIUtils")
utils.DeliverNow
'.Send
End With

'Clean up
Set oItem = Nothing
Set rItem = Nothing
Next
Exit Sub
ErrHandle:
MsgBox "Error Occurred - " & vbCrLf & Err.Description

End Sub





Ken Slovak - [MVP - Outlook] wrote:
Show the Redemption code you're using. I use Redemption all the time without
those problems. Certainly the items remain in Drafts until sent but that's
cosmetic and does not change anything in terms of functionality.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Biguana" wrote in message
ups.com...
Hi there,

I know this has come up many times before, so excuse the long
explanation, but I've searched and searched and can't solve the problem
satisfactorily.

This is my story so far.

Initial task:
Wanting to send automated personalised admin emails (not spam!) to a
couple of hundred training partners via outlook (sometimes including
personalised attachments etc). I started trying to use Outlook VBA
objects from Excel and Access as I've done many times before.

The problem:
The 2 messages:
a) "A PROGRAM IS TRYING TO ACCESS EMAIL ADDRESSED YOU HAVE
STORED IN OUTLOOK. DO YOU WANT TO ALLOW THIS."
Not really a problem as it's possible to allow access for ten minutes -
easily long enough.
b) "A PROGRAM IS AUTOMATICALLY TRYING TO SEND EMAIL ON YOUR
BEHALF."
Herein is the real problem. Not only does this pop up once for every
email, but it insists on a 5 second delay! Why can't it allow ten
minutes like the other warning? This requires 200 mouse clicks with a
5 second delay each time. (

Solution 1:
Download and install "Express Clickyes". First time I've used this.
Seems to do the job well enough. Saves me writing API calls to click
yes myself. I've used the APIs to enable and disable it as required.
( http://www.vb123.com/toolshed/05_doc...okmessages.htm )
Problem:
The 5 second wait is still present. For 200 emails that means over a
quarter of an hour of waiting for that progress bar (plus the time for
the code to run of course).

Solution 2:
Download and register the redemption.dll (
http://www.dimastr.com/redemption/ ). Use the safe Outlook objects.
Problem:
It doesn't work. Emails sit in the Drafts folder italicised going
nowhere. I assume this has to do with No.1 on the Redemption FAQ page.
But it's worse than that makes out - even send & receive doesn't work.
The emails have to be individually sent. And the body has been placed
into one long line (no crlfs). I'm using Outlook 2002, SP3 connecting
to an IMAP Server.

Please can anyone help?

Thanks,

Tim


Ads