日期:2014-05-18  浏览次数:20467 次

请问在.net中2005中如何把word文档的内容都到页面中!
请大家一定要帮帮我吧!不让我会疯掉的,公司让我一周时间做好word文档导入导出,具体是这样的先从word文档把内容读到的页面上,然后还要做近一步的判断,经过校验好的数据,然后再插入到数据库中,我们公司也没人做过这样的。郁闷啊!现在已经过了好几天,可我还没什么进展,请大一定要帮帮我啊!不然我会死定了,谢谢!



------解决方案--------------------
ewebeditor最新的版本可以实现
------解决方案--------------------
word文档把内容读到的页面上,难的很,要是在网页上打开word还可以.word文档把内容读到的页面上,很难实现啊
------解决方案--------------------
帮up 没弄过
------解决方案--------------------
顶!
------解决方案--------------------
up~怎么会整个公司都没人做过
------解决方案--------------------
靠,yaf的,做人要厚道
------解决方案--------------------
mark
------解决方案--------------------
接分
------解决方案--------------------
哈哈 ,经验是积累起来的, 没做过的事更要去做.
接分.
------解决方案--------------------
用智能客户端
------解决方案--------------------
Activex
------解决方案--------------------
DOC另存为HTML的代码

public string DocToHtml(string inFileName, string outFileName)
{
string OutPut = " ";
object fileName = inFileName;
object fileSaveName = outFileName;
object vk_read_only = false;
object vk_visible = true;
object vk_true = true;
object vk_false = false;
object vk_dynamic = 2;
object missing = System.Reflection.Missing.Value;
object vk_range = missing;
object vk_to = missing;
object vk_from = missing;
Word.ApplicationClass vk_word_app = new Word.ApplicationClass();
Word.Document aDoc = null;
try
{
aDoc = vk_word_app.Documents.Open(
ref fileName, ref missing, ref vk_read_only,
ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref vk_visible, ref missing, ref missing, ref missing, ref missing);
}
catch
{

OutPut += "There was a problem opening file!\n ";
}
try
{

//Get the word saveas format from the myItem object we got from the save as combo box selected item
object vk_saveformat = Word.WdSaveFormat.wdFormatFilteredHTML;

aDoc.SaveAs(ref fileSaveName, ref vk_saveformat, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing);
}
catch
{
OutPut += "Error ! ";
}

if (aDoc != null)
{
aDoc.Close(ref vk_false, ref missing, ref missing);
}

vk_word_app.Quit(ref vk_false, ref missing, ref missing);
vk_word_app = null;