[AccessD] A2003: Outlook not working using redemption -DESPERATE

Charlotte Foust cfoust at infostatsystems.com
Thu Mar 17 10:58:56 CST 2005


It works the same way with Redemption.  You must resolve the recipients.

        omsg.Recipients.Add rs!EmailAddress
        omsg.Recipients.ResolveAll

Charlotte Foust


-----Original Message-----
From: Erwin Craps - IT Helps [mailto:Erwin.Craps at ithelps.be] 
Sent: Thursday, March 17, 2005 1:16 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE


Don't know redemption but I had some problems with Outlook 11

The e-mailadresses need to be resolved BEFORE sending.
This can be done with 

mItem.Recipients.ResolveAll
(mItem is a Outlook mailitem)

Also I noticed there is a bug in Outlook with this resolve thing. When
the new message is hidden the recipients do not resolve. So you first
need to display the message and resolve again...

I noticed that the folowing code works fine for me.

mItem.Display 'Needed to resolve: bug??? mItem.Recipients.ResolveAll
Debug.Print mItem.Recipients.ResolveAll Do While
mItem.Recipients.ResolveAll = False
	DoEvents
      Debug.Print "Waiting for recipients resolve."
      mItem.Recipients.ResolveAll
Loop
mItem.Send


Please bare in mind this is with a outlook message Item!

Erwin
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Thursday, March 17, 2005 6:23 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003: Outlook not working using redemption
-DESPERATE

Hi all
2nd Posting
I have now wasted a total of 6 and a half hours on this It can't be that
difficult - surely

Can someone please help?

Code below modified from my previous post

I have references to Outlook 11
I have references to Redemption
All that side of things is OK
I can send up to 2 emails before the code chokes The email addresses are
real, they work

All I want this thing to do is
Create the message then send it - loop the recordset then Create the
message then send it - loop the recordset then...

Simple <sigh>

Many thanks 

Darren

<Code>
Dim db As DAO.Database
Dim selSQL As String
Dim rs As DAO.Recordset

Dim gappOutlook As New Outlook.Application Dim omsg Dim msg

Set db = CurrentDb()
selSQL = "Select tmp_tblEmailAddresses.* from tmp_tblEmailAddresses" Set
rs = db.OpenRecordset(selSQL, dbOpenSnapshot)

Set omsg = gappOutlook.CreateItem(olMailItem)
Set msg = New Redemption.SafeMailItem

msg.Item = omsg

        With rs
            Do While Not .EOF
                With msg
                    .To = rs!EmailAddress
                    .cc = Me.txtCC
                    .bcc = Me.txtBCC
                    .Subject = Me.txtSubject 
                    .Attachments.Add Me.txtATTACH 
                    .Body = Me.txtBody
                    '.Display ' shows it in the email client before
sending
                    .Send
               End With
                .MoveNext
            Loop
        End With
    
   </Code>
    




--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list