Google Answers Logo
View Question
 
Q: How to send multiple messages at once from Outlook's DRAFT folder ?? ( Answered,   0 Comments )
Question  
Subject: How to send multiple messages at once from Outlook's DRAFT folder ??
Category: Computers > Programming
Asked by: marcfestnws-ga
List Price: $50.00
Posted: 09 Apr 2005 11:45 PDT
Expires: 09 May 2005 11:45 PDT
Question ID: 507207
I use Outlook 2003. I sometimes have hundreds of emails in my draft
folder (deposited there by an email merge add-on I use).

Currently, the only way to send out all those emails is by sending
each individually.

I need a way (I suppose it'll be a macro) to automatically send out
all emails located in the draft folder, with a single click. If you do
devise a macro for this, please also include instructions for how to
install the macro and for how to execute it.

Thank you.

Marc.

Request for Question Clarification by hummer-ga on 09 Apr 2005 19:03 PDT
Hi marc,

Here's the easy solution but it involves more than one click..

"Go to the draft folder and select all emails to be sent and with one
right click send all emails to the inbox folder. From there just send
all as normal."
http://groups.google.ca/groups?hl=en&lr=&client=firefox-a&rls=org.mozilla:en-US:official&selm=csbl1159fonui54a69r5pel0tq5m1om9or%404ax.com

>>>

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

Please let me know how it goes. I hope it works for you!

Will look forward to your reply,
hummer

Clarification of Question by marcfestnws-ga on 10 Apr 2005 09:23 PDT
Hummer- thank you for trying to help me with this.


The first method (moving message in draft folders to in-box) does not
work for me. As to the second method, I created the macro as
instructed, but executing it does not seem to do anything. I've pasted
the macro I've installed below. It'd be great if you do a test with
your own Outlook install and let me know what method has worked for
you so that I can then try to replicate your success.

Thank you.

Macro:

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

'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


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

Request for Question Clarification by hummer-ga on 10 Apr 2005 09:50 PDT
Hi Marc,

Remove: "This will need modification based on where it's being run."

Change: Set myDraftsFolder = myFolders("IN HERE").Folders("Drafts")
by putting the parent folder of your drafts IN HERE

Hopefully that should do it,
hummer

Clarification of Question by marcfestnws-ga on 10 Apr 2005 15:53 PDT
How do I determine the name of the parent folder of my drafts folder?

Request for Question Clarification by hummer-ga on 10 Apr 2005 19:55 PDT
Hi Marc,

The Parent folder is the folder above, or one step up, from the Drafts
folder. Yours may be "Marc" if you haven't moved the Drafts folder
from the default setting.

Follow the little dotted lines that you see to the left of your Draft
folder, they will take you to the Parent folder. For example, click on
the following link and look at the first graphic - the dots go up to
"Anne Beebe" and that is the parent folder (or Ellen Plourde in other
graphics).
http://www.sbdiocese.org/IS/Outlook%20Web%20Access%20help.htm

If you're still not sure, right-click on the top-most folder ("Marc"?)
and select "New folder". If your Drafts folder appears in the list,
"Marc" is the parent folder.

I hope that is clear. Basically, the parent folder is the folder that
your Drafts folder is in!

Will look forward to your next update,
hummer

Clarification of Question by marcfestnws-ga on 13 Apr 2005 05:06 PDT
This worked. Thank you!
Answer  
Subject: Re: How to send multiple messages at once from Outlook's DRAFT folder ??
Answered By: hummer-ga on 13 Apr 2005 05:25 PDT
 
Hi Marc,

Terrific news, thanks for letting me know!  Here is the answer again
to make it official.

>>>

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.  

Set myDraftsFolder = myFolders("put name of the parent folder of your
draft folder in here").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

Happy emailing,
hummer
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy