Question

Locked

Send all mails from my Drafts folder at one go in Outlook 2003

By rasik786 ·
Please let me know if there is anyway to send all mails from Draft folder with one click?

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Answers

by BFilmFan In reply to Send all mails from my Dr ...

You would need to create a macro with VB.

Are you familiar with the VBA Editor in Outlook at all? If not, I suggest you read the following article to get your feet wet.

Microsoft Office Outlook 2003 Inside Out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ol2003_bk/html/odc_olArticleUsingVBAInOutlook.asp

1) Start Outlook and choose Tools, Macro, Visual Basic Editor (or press Alt+F11) to open the VBA Editor.
2) In the Project window, select Project1 and expand the tree until you see ThisOutlookSession.
3) Select ThisOutlookSession and press F7 to open the Code window.
4) Enter the following in the Code window:

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("Personal Folders").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

I found the above code on the following newsgroup:

Subject: Re: Sending out multiple messages from Drafts folder at once
Newsgroups: microsoft.public.outlook.general, microsoft.public.outlook.program_vba
http://groups.google.ca/groups?hl=en&lr=&client=firefox-a&rls=org.mozilla:en-US:official&threadm=u1Aq7%24GRAHA.235%40cppssbbsa03&rnum=5&prev=/groups%3Fhl%3Den%26lr%3D%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26selm%3Du1Aq7%2524GRAHA.235%2540cppssbbsa03%26rnum%3D5


"To add a macro to the toolbar, choose View, Toolbars, Customize from the main Outlook menu. On the Commands tab in the Customize dialog box, select Macros from the Categories list. You'll see a list of macros on the right. Copy the desired macro to the toolbar or to an Outlook menu. Right-click the newly created toolbar button or menu
command to customize the name, button, and other features."
http://www.windowsitpro.com/Windows/Articles/ArticleID/21522/pg/2/2.html

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums