Skip to content

Instantly share code, notes, and snippets.

@staaldraad
Created June 27, 2017 15:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save staaldraad/0604788fbe974cd53ed59cc1e3185cce to your computer and use it in GitHub Desktop.
Save staaldraad/0604788fbe974cd53ed59cc1e3185cce to your computer and use it in GitHub Desktop.
Add-Type -assembly "Microsoft.Office.Interop.Outlook";
$outlook = New-Object -comobject Outlook.Application;
$mapi = $outlook.GetNamespace("MAPI")
$fld = $outlook.Session.GetDefaultFolder(6);
$t = $fld.GetTable("[MessageClass] = 'IPM.Microsoft.FolderDesign.FormsDescription'",1);
$c = $t.GetRowCount();
while($c -gt 0) {
$r = $t.GetNextRow();
$itm = $mapi.GetItemFromID($r.item(1));
$itm.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x6800001E"); #Get Note name
$itm.Attachments()
$c--;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment