从DOC复制文本并将其粘贴到HTML文件中。 [英] Copy text from DOC and paste it in an HTML file.

查看:151
本文介绍了从DOC复制文本并将其粘贴到HTML文件中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被困在一个项目中。我有一个格式化的doc文件。我需要复制内容,添加更多文本并将其保存为<相同文件名> .html格式。我是初学者,请帮帮我。谢谢大家。

Hi, I am stuck in a project. I have a formatted doc file. I need to copy the contents, add some more text and save it as <same file name>.html format. I am a beginner, please help me out. Thanks guys.

推荐答案

可能最安全的方法是使用exe插件到Word(我相信)。

你需要做的是:



1.使用插件读入文档对象。

2.通过添加/删除文本修改文档。

3.使用插件执行另存为...并另存为html。



如果要阅读并处理所有Word格式化自己你将有相当多的工作找出斜体,粗体,下划线,颜色,换行符的代码......并将这些代码重新格式化为HTML标签。



我没有现成的代码,但我知道它可以完成,上面提到的大多数事情都可以通过谷歌获得。确保首先阅读并理解DOM,然后启动一个小型原型。如果有效,这将是一块蛋糕。



关键词:C#,Word插件,Word自动化,C#在代码中使用Word,...等



希望这有助于您入门。
Probably the safest way is plugin to Word using the exe (I believe).
What you need to do is:

1. Read in the document object using the plugin.
2. Modify the document by adding/removing text.
3. Using the plugin do a save as... and save as html.

If you want to read it in and handle all the Word formatting yourself you´ll have quite some work figuring out the codes for italic, bold, underline, colors, linebreaks, ... and reformatting those to HTML tags.

I have no ready code for this, but I know it can be done and most things mentioned above will be available via google. Make sure you read up on it first and understand the DOM, then start a small prototype. If that works, this will be a piece if cake.

keywords: C#, Word plugin, Word automation, C# using Word in code, ... etc

hope this helps to get you started.


但是有人请说明如何执行此操作。
But anyone please show how to do this.


这篇关于从DOC复制文本并将其粘贴到HTML文件中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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