As is mentioned on the Redemption Web site MAPIUtils.DeliverNow doesn't do
much for you with Outlook 2002 and later since the MAPI spooler isn't there
any longer. I use the alternate method of invoking the Send or Send/Receive
menu commands Dmitry lists on the Web site.
What format are the messages in, is it HTML? If so you'd need to use
HTMLBody instead of using Body. In HTML vbCRLF means nothing, you'd need to
use HTML formatting br instead of using vbCRLF. Also, what about the
contents of the cells? As an experiment try setting Body to some fixed
string:
oItem.Body = "The quick brown fox" & vbCRLF & vbCRLF "jumps over the lazy
dog."
I also generally save my items before assigning a SafeMailItem object to
them, I find it works better and sets all the properties so the MAPI used by
Redemption is able to access them properly.
--
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
ps.com...
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