While I am using outlook to view and deal with messages, and at same time I want to convert some messages into PDF, but whenever I run the command line .\OfficeToPDF.exe '.\outlookmessage.msg' 'convertedNewFile.pdf' it will shutdown the Word.exe and Outlook.exe, which is very inconvenient, why it would act like this,
After debugging, I found that
in OutlookConverter.cs
`try { app = (Microsoft.Office.Interop.Outlook.Application)Marshal.GetActiveObject("Outlook.Application"); } catch(System.Exception) { app = new Microsoft.Office.Interop.Outlook.Application(); running = false; } )
// If we were not already running, quit and release the outlook object if (app != null && !running) { ((Microsoft.Office.Interop.Outlook._Application)app).Quit(); }`
Why would we affect the current running app and session? Could we not shutdown the Outlook and Word app when running the converting job?
While I am using outlook to view and deal with messages, and at same time I want to convert some messages into PDF, but whenever I run the command line .\OfficeToPDF.exe '.\outlookmessage.msg' 'convertedNewFile.pdf' it will shutdown the Word.exe and Outlook.exe, which is very inconvenient, why it would act like this,
After debugging, I found that in OutlookConverter.cs `try { app = (Microsoft.Office.Interop.Outlook.Application)Marshal.GetActiveObject("Outlook.Application"); } catch(System.Exception) { app = new Microsoft.Office.Interop.Outlook.Application(); running = false; } )
// If we were not already running, quit and release the outlook object if (app != null && !running) { ((Microsoft.Office.Interop.Outlook._Application)app).Quit(); }` Why would we affect the current running app and session? Could we not shutdown the Outlook and Word app when running the converting job?