Replicate action of opening up message in the outbox and pressing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I inherited a mail merge with several thousand records some of which have
sent and some of which haven't. The user tried to solve the problem by
dragging a bunch of records out of the Outbox into another folder and then
dragging them back into the outbox.

Now Outlook doesn't recognize these messages as spooled to send...they have
no sent date etc.

Works fine if you open up one of them and press send again.

Is there a simple VB solution to reset these to send out?

I am a VB newbie and I found the Sent and SentOn properties of the mailitem
and did this
Public Sub SendOutbox()
Dim objOutlookMsg As Outlook.MailItem
objOutlookMsg.SentOn = Now()
End Sub

Apparently both of these are read only though, so I can't get at them.

TIA-

JH
 
You need to invoke the Send method on each item, along these lines in Outlook VBA:

Dim fld as Outlook.MAPIFolder
Dim msg as Outlook.MailItem
Dim itms as Outlook.Items
On Error Resume Next
Set fld = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set itms = fld.Items
count = itms.Count
For i = count to 1 Step -1
Set msg = itms(i)
msg.Send
Next
 
You have to actually send the items using the item.Send method for every
one.
 
Thanks for the ideas to you both. I ended up getting it working now...I had
to install the redemption com add in to get around the evil vba popup
security warnings and put in a few do loops so the ISP would accept the
messages.

Its chugging through my list 30 at a time and completing a send/receive
cycle now.

I promise not to cuss Outlook for the rest of today lol.

Less of a VBA newbie than yesterday-

JH
 
You shouldn't need Redemption if you have Outlook 2003 or 2007 and derive all Outlook objects from the intrinsic Application object in OUtlook VBA.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


John H said:
Thanks for the ideas to you both. I ended up getting it working now...I had
to install the redemption com add in to get around the evil vba popup
security warnings and put in a few do loops so the ISP would accept the
messages.

Its chugging through my list 30 at a time and completing a send/receive
cycle now.

I promise not to cuss Outlook for the rest of today lol.

Less of a VBA newbie than yesterday-

JH

Ken Slovak - said:
You have to actually send the items using the item.Send method for every
one.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


John H said:
Hello,

I inherited a mail merge with several thousand records some of which have
sent and some of which haven't. The user tried to solve the problem by
dragging a bunch of records out of the Outbox into another folder and then
dragging them back into the outbox.

Now Outlook doesn't recognize these messages as spooled to send...they
have
no sent date etc.

Works fine if you open up one of them and press send again.

Is there a simple VB solution to reset these to send out?

I am a VB newbie and I found the Sent and SentOn properties of the
mailitem
and did this
Public Sub SendOutbox()
Dim objOutlookMsg As Outlook.MailItem
objOutlookMsg.SentOn = Now()
End Sub

Apparently both of these are read only though, so I can't get at them.

TIA-

JH
 
Back
Top