如何从字节数组加载Word文档 [英] How to load Word document from byte array

查看:88
本文介绍了如何从字节数组加载Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将整个MS Word文件本身保存到一个字节数组中.A希望像在文件系统上那样加载它,但要尽量少使用Microsoft.Office.Interop.Word,因为它非常慢当它得到.Open(args[])部分时.

I have the whole MS Word file itself saved into a byte array.A want to load it the way I would if it was on file system but with the minimal use of Microsoft.Office.Interop.Word because it is very slow when it gets the the .Open(args[]) part.

推荐答案

尝试一下....

      byte[] bte = File.ReadAllBytes("E:\\test.doc"); // Put the Reading file
        File.WriteAllBytes(@"E:\\test1.doc", bte); // Same contents you will get in byte[] and that will be save here 

这篇关于如何从字节数组加载Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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