title: How to extract PDF attachments from Outlook and save to Folder
body: <p>I need VBA code to use in Outlook to extract the PDF attachments from emails and save into a designated folder. The user will choose the emails.</p>
  
  <p>I have the below code but need it amended.</p>
  
  <pre><code>Public Sub SaveAutoAttach(item As Outlook.MailItem)
  
  Dim object_attachment As Outlook.Attachment
  
  Dim saveFolder As String
  ' Folder location when I want to save my file
  saveFolder = "D:\Data\Archive"
  
      For Each object_attachment In item.Attachments
  ' Criteria to save .doc files only
      If InStr(object_attachment.DisplayName, ".doc") Then
  
          object_attachment.SaveAsFile saveFolder &amp; "\" &amp; object_attachment.DisplayName
  
      End If
  
      Next
  
  
  End Sub
  </code></pre>