Looking for Outlook 2013 update for Send Drafts Macro

Status
Not open for further replies.

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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
O looking to bring in all my folders from Outlook Express (XP) to Outlook 2013 Using Outlook 3
C Looking for feedback on new Outlook Add-in Using Outlook 0
D Looking to move away from exchange to outlook.com Using Outlook 4
Aussie Looking for Outlook macro to Copy Recipient Names into Email Body Outlook VBA and Custom Forms 3
R Outlook Template: Looking to distribute a VBA Outlook template to other people Using Outlook 1
Q Looking for Outlook 2010 Close Event Id Exchange Server Administration 1
S Looking for client-side method (Outlook 2007/Exchange 2007) for users to delete Outlook VBA and Custom Forms 2
P Outlook looking for Copy of Outlook.pst Outlook VBA and Custom Forms 1
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
B Looking to get the Recipient email address (or even the "friendly name") from an email I am replying to using VBA Outlook VBA and Custom Forms 4
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
G Looking for help with our Organization Forms Library Outlook VBA and Custom Forms 1
peacepanda How to save attachment looking at the attachment name Outlook VBA and Custom Forms 1
M Looking for options and best practices for an Edge Server (Exchange or not) Exchange Server Administration 0
M Looking for trainer in Business Contact Manager BCM (Business Contact Manager) 0
B Looking for an add-in or a way to send automatic replies based off a list Using Outlook 2
J Looking for a solution (maybe an add-in) to easily track email conversations Using Outlook 3
I Looking for a productivity add-in similar to "Nostalgy" for Thunderbird Using Outlook 5
C Looking for way to tie a Business Contact to more than one Account BCM (Business Contact Manager) 5
J OL2003 Macro disables itself - looking for way to automate 'enable' Using Outlook 2
R Looking for my BCM backup files BCM (Business Contact Manager) 1
B Looking for email address under ItemSend event Outlook VBA and Custom Forms 6
S Looking for a Utility for Editting An Exported Rules (.rwz) File Using Outlook 6
U looking for feedback on installation process and on eMarking Assis Outlook VBA and Custom Forms 1
e_a_g_l_e_p_i Need clarification on 2-Step Verification for Gmail using Outlook 2021 Using Outlook 8
L Opening People Outlook 2021 Using Outlook 1
e_a_g_l_e_p_i Outlook 2021 not letting me setup my Gmail using pop Using Outlook 1
Geldner Problem submitting SPAM using Outlook VBA Form Outlook VBA and Custom Forms 2
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
M Outlook 2016 outlook vba to look into shared mailbox Outlook VBA and Custom Forms 0
P Can no longer sync Outlook with iPhone calendar after iPhone update to 17.1.1 Using Outlook 2
O Outlook - Switch from Exchange to IMAP Using Outlook 0
e_a_g_l_e_p_i Is it possible to have a reminder in Outlook 2021 for every 90 days Using Outlook 3
farrissf Outlook 2016 Optimizing Email Searches in Outlook 2016: Seeking Insights on Quick Search vs Advanced Search Features Using Outlook 0
C Advanced search terms for "Outlook Data File" Using Outlook 1
N Reply to Outlook messages by moving messages to a specific Outlook folder Outlook VBA and Custom Forms 1
O How to find out the domain and server settings that my Outlook is using? Using Outlook 2
A Outlook 365 (OutLook For Mac)Move "On My Computer" Folder Items From Old To New Mac Computer Using Outlook 3
H Integrating Alexa & Outlook Pro 2021 Using Outlook 2
Z Automatically adjust Outlook Reading Pane from bottom to right depending on portrait or landscape window Using Outlook 1
Rupert Dragwater Background colors not saving in Outlook 365 Using Outlook 15
petunia Outlook tasks module sunsetting? Exchange Server Administration 3
G Save emails as msg file from Outlook Web AddIn (Office JS) Outlook VBA and Custom Forms 0
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 3
U Outlook 2021 not showing contact cards in Searches Using Outlook 1
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 2
H Outlook 365 O365 outlook calendar item editing Using Outlook 1
J Outlook 365 html inline images Using Outlook 0
Rupert Dragwater How to get Outlook 365 to open from websites Using Outlook 5
S Why do I have to close and reopen Outlook for macros to work? Outlook VBA and Custom Forms 2

Similar threads

Top