title: Copy text from word file to a new word
body: <p>I am reading the text from word file and replace some text from the readed text.</p>
  
  <pre><code>var wordApp = new Microsoft.Office.Interop.Word.Application();
  object file = path;
  
  object nullobj = System.Reflection.Missing.Value;
  
  var doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj,
                                                   ref nullobj, ref nullobj, ref nullobj,
                                                   ref nullobj, ref nullobj, ref nullobj,
                                                   ref nullobj, ref nullobj, ref nullobj);
   doc.ActiveWindow.Selection.WholeStory();
  
  doc.ActiveWindow.Selection.Copy();
  
  IDataObject data = Clipboard.GetDataObject();
  var text =data.GetData(DataFormats.Text);
  </code></pre>
  
  <p>So I have text from original word file, and now I need it to pass to a new word file which not exist (New Text).</p>
  
  <p>I tried </p>
  
  <pre><code> ProcessStartInfo startInfo = new ProcessStartInfo();
   startInfo.FileName = "WINWORD.EXE";
   Process.Start(startInfo);
  </code></pre>
  
  <p>This opens new word file which not saved physically in file system which is fine. But I am not sure how can pass the text value to this new file.</p>
  
  <p><strong>Update</strong></p>
  
  <p>After running above code I tried </p>
  
  <pre><code> var wordApp = new Microsoft.Office.Interop.Word.Application();            
   var doc = wordApp.ActiveDocument;
  </code></pre>
  
  <p>Which comes up with  <strong><em>"This command is not available because no document is open."</em></strong></p>