Looking for Outlook 2013 update for Send Drafts Macro

Bren

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2010
Does anyone know of a way to get this macro to work in Outlook 2013 or do you have suggestions for a new method? We're currently using it in Outlook 2003 to send multiple e-mails from our 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("SC").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
 

Bren

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2010
What happens when you try it? It's pretty basic and should work with outlook 2013.
Hi Diane,
We were able to get it working today, without making any changes. All we needed was the threat of your help (it's like what happens when your appliances stop working until the very second that a repairman sets foot on your premises. lol)

Thanks!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
I'm not sure if that's good or bad. LOL

Was the problem with macro security settings? That's a common cause with new setups.
 

Bren

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2010
I'm not sure if that's good or bad. LOL

Was the problem with macro security settings? That's a common cause with new setups.
Hi Diane,
No, our Security settings were fine. It would run for our personal mailboxes but wouldn't run for our group's functional mailboxes. It would run fine with both types of mailboxes in Outlook 2003 but wouldn't in Outlook 2013. Same code. We wouldn't get error messages---it would just hang. Finally I just deleted the code (again, for like the 10th time) and this time it worked.
 
Top