title: Export or Print Outlook Emails to PDF
body: <p>I am using PowerShell to loop through designated folders in Outlook and saving the attachments in a tree like structure. This works wonders, but now management has requested the email itself be saved as a PDF as well. I found the <code>PrintOut</code> method in object, but that prompts for a file name. I haven't been able to figure out what to pass to it to have it automatically save to a specific filename. I looked on the MSDN page and it was a bit to high for my current level.</p>
  
  <p>I am using the com object of outlook.application.</p>
  
  <p>Short of saving all of the emails to a temp file and using a third party method is there parameters I can pass to PrintOut? Or another way to accomplish this?</p>
  
  <p>Here is the base of the code to get the emails. I loop through $Emails</p>
  
  <pre><code>$Outlook = New-Object -comobject outlook.application
  $Connection = $Outlook.GetNamespace("MAPI")
  #Prompt which folder to process
  $Folder = $Connection.PickFolder()
  $Outlook_Folder_Path = ($Folder.FullFolderPath).Split("\",4)[3]
  $BaseFolder += $Outlook_Folder_Path + "\"
  $Emails = $Folder.Items
  </code></pre>