Results 1 to 5 of 5

Thread: Mass Send?

  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Hello All,

    I have a drafts folder full of Emails ready to be sent. Is there any way to send then all at once, i.e. w/o opening each one and pressing the SEND button? If you know how to do this in VBA even better...
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    I tried dragging a Draft item to Outbox and pressing F9. That didn't work...

    VBA could automate opening and sending the messages, assuming there is no shortcut.

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Quote Originally Posted by jscher2000 View Post
    I tried dragging a Draft item to Outbox and pressing F9. That didn't work...

    VBA could automate opening and sending the messages, assuming there is no shortcut.
    Jefferson,

    Yeah! I tried draging 9 items to the outbox hoping....
    My problem is that I am totally unfamiliar with the Outlook Object Model which makes it very hard to use online help or the object browser to find what you need. Know of any good books on the subject?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    This worked with three messages in a limited test. Note that I used the Sleep API call to slow it down just a bit.

    Code:
    Sub SendAllDrafts()
    ' Send the messages in the Drafts folder (ignore any subfolders)
    If MsgBox("Are you sure you want to send ALL the items in your default Drafts folder?", _
        vbQuestion + vbYesNo) <> vbYes Then Exit Sub
    Dim fldDraft As MAPIFolder, msg As Outlook.MailItem, intCount As Integer
    Set fldDraft = Outlook.GetNamespace("MAPI").GetDefaultFolder(olFolderDrafts)
    intCount = 0
    Do While fldDraft.Items.Count > 0
        Set msg = fldDraft.Items(1)
        msg.Send
        Sleep 500
        intCount = intCount + 1
    Loop
    If Not (msg Is Nothing) Then Set msg = Nothing
    Set fldDraft = Nothing
    MsgBox intCount & " messages sent", vbInformation + vbOKOnly
    End Sub
    Sleep API declaration for top of module:

    Code:
    'Declare Sleep API
    Private Declare Sub Sleep Lib "kernel32" (ByVal nMilliseconds As Long)

  5. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Jefferson,

    Thanks again!

    Works like a charm.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •