将Interop Word.Document对象转换为Stream

时间:2014-06-26 10:26:04

标签: c# .net office-interop syncfusion

        object missing = System.Reflection.Missing.Value;
        object readOnly = false;
        object isVisible = true;
        object fileName = "C:\\Users\\10603726\\Desktop\\test.doc";
        ApplicationClass applicationWord = new ApplicationClass();
        Microsoft.Office.Interop.Word.Document newsDoc = new Microsoft.Office.Interop.Word.Document();

        try
        {

            newsDoc = applicationWord.Documents.Open(ref fileName, ref missing, ref missing, ref  missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
            newsDoc.Activate();

            //I want to convert this document to a System.IO.Stream
        }

我正在从磁盘打开文档(newsDoc)。我想将此 newsDoc 文档转换为System.IO.Stream我该怎么做?

0 个答案:

没有答案