Monday, April 11, 2011

How to send multiple drafts from Outlook 2003

Outlook wont let me send multiple drafts at the same time. Is there an easy way to send multiple drafts at once in outlook? without having to open each one individually?

From what i've read, seen and tried; this is not possible from within outlook itself, and thus a programming solution would be required, probably some VB script

From stackoverflow
  • Yes, you can write a macro or add-in to do that.

  • ok, i found a bit of VB that does it:

    `Public Sub SendDrafts()
    
    Dim lDraftItem As Long
    Dim myOutlook As Outlook.Application
    Dim myNameSpace As Outlook.NameSpace
    Dim myFolders As Outlook.Folders
    Dim myDraftsFolder As Outlook.MAPIFolder
    
    'Send all items in the "Drafts" folder that have a "To" address filled
    'in.
    
    'Setup Outlook
    
    Set myOutlook = Outlook.Application
    Set myNameSpace = myOutlook.GetNamespace("MAPI")
    Set myFolders = myNameSpace.Folders
    
    
    'Set Draft Folder.  This will need modification based on where it's
    'being run.
    
    Set myDraftsFolder = myFolders("$MAILBOX").Folders("$DRAFTS")
    
    'Loop through all Draft Items
    
    For lDraftItem = myDraftsFolder.Items.Count To 1 Step -1
    
    'Check for "To" address and only send if "To" is filled in.
    
    If Len(Trim(myDraftsFolder.Items.Item(lDraftItem).To)) > 0 Then
    
    'Send Item
    
    myDraftsFolder.Items.Item(lDraftItem).Send
    
    End If
    Next lDraftItem
    
    'Clean-up
    
    Set myDraftsFolder = Nothing
    Set myNameSpace = Nothing
    Set myOutlook = Nothing
    
    End Sub
    

    just replace $MAILBOX with your mailbox name and $DRAFTS with the name of your drafts folder. This has been personnaly tested and seems to work fine.

  • AWESOME!!!! This Macro worked perfectly for me, cheers. :-)

0 comments:

Post a Comment