PDA

View Full Version : Send everything in the Draft folder



xjetjockey
06-10-2008, 11:32 AM
I do Excel VBA, and due to a wierd error cannot get it to send in Outlook. It will Save just fine, however. I have no clue how to do this in Outlook, but does anyone have a Sub that will take every email in the draft folder and send it?
Thanks.
Robert

Oorang
07-09-2008, 10:58 AM
Do you want it done from Excel or Outlook?

xjetjockey
07-11-2008, 07:08 AM
In Outlook. Thanks.
Robert

Oorang
07-11-2008, 07:18 AM
Public Sub SendAllInDraft()
Dim ns As Outlook.NameSpace
Dim objItm As Object
Dim mi As Outlook.MailItem
Set ns = Outlook.Session
For Each objItm In ns.GetDefaultFolder(olFolderDrafts).Items
If TypeName(objItm) = "MailItem" Then
Set mi = objItm
mi.Send
End If
Next
End Sub