在WinForms应用程序中嵌入Word文档预览 [英] Embed Word document preview in WinForms app
问题描述
如何将Word文档嵌入到资源管理器预览面板一样的表单或用户控件中?
How can I embed a word document in a form or usercontrol like the explorer preview panel does?
我找到了此主题并且他们说DSOFramer不再可用,但是我现在应该使用什么?第三方工具只有免费才可以接受.
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.
我唯一注意到的是prevhost.exe使用-Embedding命令开关启动了winword.exe进程,但是我找不到关于此开关的任何信息.
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.
推荐答案
好的,我找到了解决方案,这很明显.我创建了一个访问 IPreviewHandler IPreviewHandler 从像Windows资源管理器这样的单词开始,并在我的控件中托管预览.我使用的CLSID是{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE}
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}
您可以使用Windows 7 API代码包进行接口声明.我不知道它的官方软件是否得到微软的支持,但对我来说,它能胜任.
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.
这篇关于在WinForms应用程序中嵌入Word文档预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!