title: Drag and drop outlook selected attachtment with powershell
body: <p>I've managed to get all attachment from a mail and save it to a location.
  Now i am trying to to drag and drop it to a listbox.
  Now it gets all the attachements, but i want only the selecte on in the outlook message.</p>
  <pre><code>$outlook = New-Object -comobject outlook.application
  $sel=$outlook.ActiveExplorer().selection 
      foreach ($s in $sel) {
        foreach ($at in $s.Attachments) 
          {if ($at.FileName -match 'SCAN_*') 
                   {$newname=[io.path]::ChangeExtension($Filesgo_listbox.SelectedItem,&quot;PDF&quot;) 
                     if ($newname -NOTmatch &quot;20*&quot;) {$newname= $DATUM + &quot; &quot; + $newname}
                     $name= join-path $curfil $newname }
              else {$name=join-path $curfil $at.FileName}
     
  </code></pre>