title: I want to print my student form to docx
body: <p>I have a form that can show the result of my student.</p>
  
  <p>This is the program's look:</p>
  
  <p><a href="https://i.stack.imgur.com/jp0aw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jp0aw.png" alt="this is the program&#39;s look"></a></p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Class Form2
      Private Sub PenilaianBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
          Me.Validate()
          Me.PenilaianBindingSource.EndEdit()
          Me.TableAdapterManager.UpdateAll(Me.MahasiswaDataSet)
  
      End Sub
  
      Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
          'TODO: This line of code loads data into the 'MahasiswaDataSet.penilaian' table. You can move, or remove it, as needed.
          Me.PenilaianTableAdapter.Fill(Me.MahasiswaDataSet.penilaian)
          NimTextBox.Text = ""
          NamaLabel1.Text = ""
          NimLabel1.Text = ""
          TugasLabel1.Text = ""
          UlanganLabel1.Text = ""
          UtsLabel1.Text = ""
          UasLabel1.Text = ""
          HasilLabel1.Text = ""
          SkorLabel1.Text = ""
      End Sub
  
      Private Sub btnoke_Click(sender As Object, e As EventArgs) Handles btnoke.Click
          Try
              Dim dt = PenilaianTableAdapter.GetDataBycaridata(NimTextBox.Text)
              If dt.Rows.Count &lt;&gt; 0 Then
                  NamaLabel1.Text = dt.Rows(0).Item(1)
                  NimLabel1.Text = dt.Rows(0).Item(2)
                  TugasLabel1.Text = dt.Rows(0).Item(3)
                  UlanganLabel1.Text = dt.Rows(0).Item(4)
                  UtsLabel1.Text = dt.Rows(0).Item(5)
                  UasLabel1.Text = dt.Rows(0).Item(6)
                  HasilLabel1.Text = dt.Rows(0).Item(7)
                  SkorLabel1.Text = dt.Rows(0).Item(8)
              Else
                  MsgBox("NIM Yang Anda Input Salah Atau Data Anda Belum Diinput. Silahkan Coba Lagi", MsgBoxStyle.Critical, "Info")
                  NimTextBox.Text = ""
                  NamaLabel1.Text = ""
                  NimLabel1.Text = ""
                  TugasLabel1.Text = ""
                  UlanganLabel1.Text = ""
                  UtsLabel1.Text = ""
                  UasLabel1.Text = ""
                  HasilLabel1.Text = ""
                  SkorLabel1.Text = ""
              End If
          Catch ex As Exception
              MsgBox(ex.Message)
          End Try
      End Sub
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          Me.Hide()
          Form3.Show()
      End Sub
  End Class
  </code></pre>
  
  <p>The problems are:</p>
  
  <ol>
  <li><p>I want to print the result of "Oke" button such as; Nama, NIM, Tugas, Ulangan, UTS, UAS, hasil and skor to Microsoft Word template that I've created.</p>
  
  <p>This is the docx template:
  <a href="https://i.stack.imgur.com/FU4bj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FU4bj.png" alt="this is the docx template"></a></p></li>
  <li><p>I don't know how the code is and how to do that.</p></li>
  </ol>
  
  <p>Please help me.</p>