<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Open a word processing document from a stream</title><link>https://sourceforge.net/p/asposeopenxml/wiki/Open%2520a%2520word%2520processing%2520document%2520from%2520a%2520stream/</link><description>Recent changes to Open a word processing document from a stream</description><atom:link href="https://sourceforge.net/p/asposeopenxml/wiki/Open%20a%20word%20processing%20document%20from%20a%20stream/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 26 May 2015 04:32:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/asposeopenxml/wiki/Open%20a%20word%20processing%20document%20from%20a%20stream/feed" rel="self" type="application/rss+xml"/><item><title>Open a word processing document from a stream modified by Aspose Marketplace</title><link>https://sourceforge.net/p/asposeopenxml/wiki/Open%2520a%2520word%2520processing%2520document%2520from%2520a%2520stream/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -35,4 +35,4 @@

 ## Download ##

-* [Sample Code]()
+* [Sample Code](http://sourceforge.net/projects/asposeopenxml/files/Aspose.Words%20Vs%20OpenXML/OpenDocumentFromStream.zip/download)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aspose Marketplace</dc:creator><pubDate>Tue, 26 May 2015 04:32:31 -0000</pubDate><guid>https://sourceforge.netfc2a7a3a7fe31034c01cbf296c1aa6906bc8543f</guid></item><item><title>Open a word processing document from a stream modified by Aspose Marketplace</title><link>https://sourceforge.net/p/asposeopenxml/wiki/Open%2520a%2520word%2520processing%2520document%2520from%2520a%2520stream/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,4 +1,4 @@
-## OpenXML Word ##
+## OpenXML Words ##

 The example **OpenAndAddToWordprocessingStream** method shown here can be used to open a Word document from an already open stream and append some text using the Open XML SDK. You can call it by passing a handle to an open stream as the first parameter and the text to add as the second. For example, the following code example opens the file OpenDocumentFromStream.docx in the Public Documents folder and adds text to it.
 Below is the sample code
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aspose Marketplace</dc:creator><pubDate>Mon, 25 May 2015 19:36:15 -0000</pubDate><guid>https://sourceforge.net370acbca1f56628e027c63f74336d70ca011b95c</guid></item><item><title>Open a word processing document from a stream modified by Aspose Marketplace</title><link>https://sourceforge.net/p/asposeopenxml/wiki/Open%2520a%2520word%2520processing%2520document%2520from%2520a%2520stream/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="openxml-word"&gt;OpenXML Word&lt;/h2&gt;
&lt;p&gt;The example &lt;strong&gt;OpenAndAddToWordprocessingStream&lt;/strong&gt; method shown here can be used to open a Word document from an already open stream and append some text using the Open XML SDK. You can call it by passing a handle to an open stream as the first parameter and the text to add as the second. For example, the following code example opens the file OpenDocumentFromStream.docx in the Public Documents folder and adds text to it.&lt;br /&gt;
Below is the sample code&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;        string txt = "Append text in body - OpenAndAddToWordprocessingStream";
        Stream stream = File.Open(OpenDocumentFromStream.docx, FileMode.Open);
        OpenAndAddToWordprocessingStream(stream, txt);
        stream.Close();
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="asposewords"&gt;Aspose.Words&lt;/h2&gt;
&lt;p&gt;Simply pass a stream object that contains a document to the &lt;strong&gt;Document&lt;/strong&gt; constructor. &lt;br /&gt;
Below is the sample code&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;        string txt = "Append text in body - OpenAndAddToWordprocessingStream";
        //intialize stream by defining file mode
        Stream stream = File.Open(OpenDocumentFromStream.docx, FileMode.Open);
        OpenAndAddToWordprocessingStream(stream, txt);
        private static void OpenAndAddToWordprocessingStream(Stream stream, string txt)
        {
           // Load the entire document into memory.
           Document doc = new Document(stream);
           // You can close the stream now, it is no longer needed because the document is in memory.
           stream.Close();
           //intialize documentbuilder to insert text from stream into word document
           DocumentBuilder db = new DocumentBuilder(doc);
           db.Writeln(txt);
           doc.Save(OpenDocumentFromStream.docx);
        }
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="download"&gt;Download&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="../"&gt;Sample Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aspose Marketplace</dc:creator><pubDate>Mon, 25 May 2015 19:30:35 -0000</pubDate><guid>https://sourceforge.net2c7b6b59d35b757e671fe2d1dadb72ccc7c89987</guid></item></channel></rss>