0

I would like to know if a message has been send by Outlook 2016 with POwershell... The solution is maybe to know if this message appears in the sended folder

I found how to connect to Outlook and to use objects but for the moment no solution in order to list files in the folder sended elements the name of this folder should be olFolderSentMail

so i was thinking to use

$olFolderInbox = 6
$ol = new-object -comobject "Outlook.Application"
$namespace = $ol.getnamespace("mapi")

$namespace.Folders(olFolderSentMail)

Could you help me

Thanks for your advices

Jean-Marc

  • 1
    Can you show your progress? This site is for asking specific questions about issues with your code, not to ask someone else to do the code for you. – Tanaka Saito Dec 03 '20 at 23:18
  • $olFolderInbox = 6 $ol = new-object -comobject "Outlook.Application" $namespace = $ol.getnamespace("mapi") – jean-marc caspar Dec 05 '20 at 15:19
  • You are defining a variable `$olFolderInbox`, but use something undefined `olFolderSentMail`. Look at the [OlDefaultFolders enumeration](https://learn.microsoft.com/en-us/office/vba/api/outlook.oldefaultfolders). These enum values are constant values in Outlook. It is NOT a folder name. – Theo Dec 07 '20 at 15:32

0 Answers0