cognidox / OfficeToPDF

A command line tool to convert Microsoft Office documents to PDFs
https://www.cognidox.com/
Other
609 stars 137 forks source link

Converted EML files (to MSG Files) are rejected by OfficeToPDF #96

Open Resurg3nt1 opened 1 year ago

Resurg3nt1 commented 1 year ago

I am using Rebex MailConverter to convert to-mime (.msg) emails that are originally formatted as .eml. The reason for this is that OfficeToPDF does not allow for conversion of .eml messages to .msg files despite the fact that Outlook 2010 onwards supports them. I should also be clear that I have manually re-saved the emails after opening them in Outlook to .msg format to test whether the error I am encountering is because of MailConverter messing up the conversion. That is not the case - if I convert any eml file to msg and then try to convert the file to PDF, I receive the following error from OfficeToPDF:

Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
Did not convert

I have tried to kill the outlook process prior to invoking the call to convert the file but to no avail.

Anyone got any ideas on why this is happening? The email opens fine in Outlook, has no glitches whatsoever. I can manually print it to a PDF in Outlook using Print to PDF, and it looks great. However, I do not want the end user to have to do that if it can be avoided because the whole point of this is to automate the conversion and this step.

I am using Office 2021 and its activated, in case that is relevant.

jaydubal commented 4 months ago

It will work till Office 2019, since then Microsoft has stopped COM / Interop support for Office. Hence this (or any such tool) wont work.