Open afetscher opened 3 years ago
Or check before if it's running and depending on it close it or not :)
Thanks for the feedback, I will resolve that
I just resolved the issue. I will update the systray file tomorrow
I will now use the comobject as below:
$Get_Outlook_Process = get-process outlook -ea silentlycontinue
If($Get_Outlook_Process -ne $null)
{
$outlook = [Runtime.InteropServices.Marshal]::GetActiveObject("Outlook.Application")
}
Else
{
$Outlook = New-Object -ComObject Outlook.Application
}
AboutMyDevice_Systray.ps1
$Mail.Send()
$Outlook.Quit()
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($Outlook) | Out-Null
I think it would be better to omit the close, because Outlook is permanently used by users.