如何使用C#的interop将MS word Document转换为HTML格式? [英] How to convert MS word Document to HTML format using interop with C#?

查看:112
本文介绍了如何使用C#的interop将MS word Document转换为HTML格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#使用互操作将Word文档转换为HTML格式?

请尽快给出答案。



谢谢

Mahendra Kumar Das

How to convert word Document To HTML format using interop with C#?
please give answer as soon as possible.

Thanks
Mahendra Kumar Das

推荐答案

没有这样的转换只是因为Word和HTML之间没有一对一的对应关系。你可以做一些事情,但输入应该分为两部分:文档本身和一些映射模型来映射两者,一组映射规则或类似的东西。



Word本身提供了一些另存为HTML操作,但它总是被批评为高度膨胀。我必须承认,在视觉上,在Word的最新版本中,结果非常接近地模仿原始文档并且看起来非常整洁,但过去的转换是一场灾难。



要使用单词,你可以使用MS Office Interop Word。请参阅:



http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word%28v=office.14%29.aspx [ ^ ],

http://msdn.microsoft.com/en -us / library / ff597928.aspx [ ^ ],

http://msdn.microsoft.com /en-us/library/ff601860.aspx [ ^ ]。



祝你好运,

-SA
There is no such "conversion" simply because there is no one-to-one correspondence between Word and HTML. You can do something, but the input should come in two parts: the document itself and some mapping model to map the two, a set of mapping rules or something like that.

Word itself provides some "Save as HTML" operation, but it was always criticized as highly bloated. I must admit that visually, in last versions of Word, the result imitates original document very closely and looks pretty neat, but past conversions were a disaster.

To work with Word, you can use MS Office Interop Word. Please see:

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word%28v=office.14%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ff597928.aspx[^],
http://msdn.microsoft.com/en-us/library/ff601860.aspx[^].

Good luck,
—SA


http://www.c-sharpcorner.com/UploadFile/munnamax/WordToHtml03252007065157AM/WordToHtml.aspx [ ^ ]

http://stackoverflow.com/questions/2266097/convert-from-word-document-to-html [ ^ ]


这篇关于如何使用C#的interop将MS word Document转换为HTML格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆