在内存中创建o WordProcessingDocument。 [英] Creation of o WordProcessingDocument in memory.

查看:210
本文介绍了在内存中创建o WordProcessingDocument。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WordprocessingDocument currentDocument = null;

WordprocessingDocument currentDocument = null;

currentDocument = WordprocessingDocument.Create(??????,WordprocessingDocumentType.Document);

currentDocument = WordprocessingDocument.Create(??????,WordprocessingDocumentType.Document);

 

我尝试过使用类流,但无法实例化Stream类。我还尝试将MemoryStream类传递给WordProcessingDocument.Create();以编译错误结束。我想要做的是在内存
中创建文档,并在用户决定点击保存按钮后保存到指定的路径。

I have tried using the Class Stream but was unable to instantiate a class of the type Stream. I also tried passing a MemoryStream class into WordProcessingDocument.Create(); which ended in a compiler error. What I want to do is create the document in memory and save to a specified path later when the user decides to hit the save button.

 

谢谢

推荐答案

如果你还没有提到过这篇文章

If you have not already referred to the article

使用内存中的Open XML文档

http://msdn.microsoft.com/en-us/library/ee945362(office.11​​).aspx

 

它是处理类似于您需要的内存流的一般指南。它演示了创建MemoryStream类的代码。当您将该类的对象传递给WordProcessingDocument.Create()方法时,您没有
说出编译器错误是什么。知道在回复你的帖子时对其他论坛浏览器有帮助。

it is a general guide to processing memory streams similar to what you need. It demonstrates code that creates MemoryStream classes. When you pass the object of that class into the WordProcessingDocument.Create() method you don't say what the compiler error is. Knowing that could be helpful to other Forum browsers when responding to your post.

 

其他可能有用的资源包括

Other resources which may be useful include

 

http://blogs.technet .com / b / migreene / archive / 2006/04/15 / 425331.aspx

这个链接指向在网站上用.NET创建一个Open XML Document"Open XML Developers'Org"。页面

 

示例代码创建DOCX文件

http://blogs.msdn.com/b/brian_jones /archive/2006/06/29/651190.aspx

该博客有多年的XML编程和打包内容。

 

演练:Word 2007 XML格式

http://msdn.microsoft.com/en-us/library/bb266220(office.12).aspx?info = EXLINK

 

Stream类有很多派生。使用Visual Studio浏览器并查询单词'stream'。浏览许多基类和子类以匹配您的需求.MSDN文章调用MemoryStream对象。
浏览器中显示的.NET类显示System.IO.MemorySteam和System.IO .UnmanagedMemoryStream。

Stream class comes in many derivations. Use the Visual Studio browser and query on the word 'stream'. Browse through the many base and child classes to match one to your needs. The MSDN article invokes the MemoryStream object. .NET classes shown in the browser show System.IO.MemorySteam and System.IO.UnmanagedMemoryStream.

 


这篇关于在内存中创建o WordProcessingDocument。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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