Embed Word document preview in WinForms app

寵の児 提交于 2020-01-15 09:04:49

问题


How can I embed a word document in a form or usercontrol like the explorer preview panel does?

I found this topic and they say DSOFramer isn't available any more, but what should I use now? A third party tool is only acceptable if its free.

The only thing I noticed was that prevhost.exe starts a winword.exe process with the -Embedding command switch, but I can't find any information on this switch.


回答1:


Okay I found the solution, it was kinda obvious. I created a UserControl which accesses the IPreviewHandler from word like the windows explorer does and host the preview in my control. The CLSID I use is {84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}

You can use the Windows 7 API Code Pack for the interface declarations. I don't know if its offical supported by microsoft but for me it did the job.



来源:https://stackoverflow.com/questions/4796994/embed-word-document-preview-in-winforms-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!