![](/img/trans.png)
[英]how to Convert byte[] to Word of interop object(to a word document)?
[英]How to convert an Interop.Word.Document object to a stream or byte array?
我正在嘗試將我在內存中創建的Word文檔上載到Sharepoint 2010,看來這樣做的唯一方法是將其轉換為字節數組或流。 無論如何,我無需先將其保存到磁盤即可執行此操作?
此鏈接: http : //social.msdn.microsoft.com/forums/en-US/vsto/thread/84f1ac3f-f078-4087-a627-351d6bb57173/
建議正確的方法是
將文檔轉換為IPersistFile接口,然后只需執行“ Save(path,false)”方法:
var iPersistFile = (IPersistFile)this.Application.ActiveDocument;
iPersistFile.Save("[path]",false);
所有功勞歸功於這些人:
http://blogs.msdn.com/b/pranavwagh/archive/2008/04/03/how-to-do-a-save-copy-as-in-word.aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.