title: How to convert a Document Instance to a FileStream
body: <p>I've Been struggling with this in the past hour.</p>
  
  <p>Can someone help me to convert an instance of Microsoft.Office.Interop.Word.Document to FileStream? I have this function below which does not work but might help you guys to have an idea of what im trying to do:</p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Linq;
   using System.Runtime.Serialization;
   using System.ServiceModel;
   using System.Text;
   using Microsoft.Office.Interop.Word;
   using System.IO;
  
   namespace DropDownTemplate.Web.WebServices.Word
   {
       // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "WordGenerator" in code, svc and config file together.
       public class WordGenerator : IDocumentGenerator
       {
           FileStream IDocumentGenerator.GenerateDocument()
           {
               // For optional parameters create a missing object
               object missing = System.Reflection.Missing.Value;
               // open the document specified in the fileName variable
               Document adoc = new Document();
               adoc.InlineShapes.AddPicture(@"http://localhost:2014/Resources/MG.PNG", ref missing, ref missing, ref missing);
               using (StreamReader y = new StreamReader())
               {
                   y.Read(adoc);   
               }
               return adoc;
           }
       }
   }
  </code></pre>