Hi all,
I am programming a window service (c#), which convert a doc/docx file to html.
After test unit, everything is very OK, but when it run it service mode, it throw an exception when saving the doc file to html.
Following is my codes:

1 solution

Solution 2

People always perform the tasks by MS Office control on server side, which is really unreasonable since if Office controls are performed on server mode, it needs very complex configurations and hard successfully to realize the task. So it is not suggested. In such a case, you need to use a third party library. what I am familiar is a MS Word component[^], it can directly used in the server side, and convert word doc and docx to html also can convert html to word doc docx directly. You can see the solution in below article: