title: Outlook 2013 using VBA to Send Drafts
body: <p>Good morning,</p>
  
  <p>Using Outlook 2010 I compiled code to send all emails that were saved in a drafts folder of a given account.  Now I've upgraded to Office 2013 I am getting an error...  It is the .Send bit where it falls over and presents the error message:</p>
  
  <p>"This method can't be used with an inline response mail item."</p>
  
  <p>I am certain that there is a v simple method for sending drafts, but I have scoured the web and can't figure it as yet.</p>
  
  <pre><code>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("accounts@credec.co.uk").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
  </code></pre>