How to 'Copy' NOT 'Move' Outlook Mail Message to Another Folder in That Inbox

I ended up solving the issue by using “Invoke PowerShell” activity and wrote a custom script to copy emails based on subject. You can also specify based on EmailID, From, BCC, etc.

Emails are being copied from Inbox\SubFolder to SentItems\TEMP, where “Email_Subject” is a variable being passed into the PS code.

Hope someone else finds some use in this!

$outlook = New-Object -comobject outlook.application; 

$Inbox = $outlook.GetNamespace('MAPI').GetDefaultFolder(6); 
$subFolders =  $Inbox.Folders | ? {$_.FolderPath.EndsWith('SubFolder')};

$SendItems = $outlook.GetNamespace('MAPI').GetDefaultFolder(5); 
$subFolders2 = $SendItems.Folders | ? {$_.FolderPath.EndsWith('TEMP')};
$Final = $subFolders.Items | ForEach-Object {If ($_.Subject -Like '*"+Email_Subject+"*'){$_.Copy().Move($subFolders2)}}
3 Likes