+ Reply to Thread
Results 1 to 2 of 2

Need Excell Macro to send out all the emails from Outlook Drafts folder

  1. #1
    Registered User
    Join Date
    11-11-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    23

    Need Excell Macro to send out all the emails from Outlook Drafts folder

    Hi,

    I have 100 emails in draft folder, i need a excell macro to send them out at the same using only one click.

    Can you please share anybody the vba code to do this.

  2. #2
    Registered User
    Join Date
    11-11-2012
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Need Excell Macro to send out all the emails from Outlook Drafts folder

    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.

    Set myDraftsFolder = myFolders("Mailbox" name).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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1