title: Printing a document in C#
body: <p>I am trying to print a document with .txt extension and for that I am referring to my course book but confused. Here is the source code given in the book :</p>
  
  <pre><code>private void Print_Click(object sender, EventArgs e)
  {
  printDialog1.Document = printDocument1 // there is no object in my program names ad printDocument1
  DialogResult result = printDialog1.ShowDialog();
  if (result == DialogResult.OK)
  {
  printDocument1.Print();
  </code></pre>
  
  <p>and there is lot more code given </p>