0

I have form with many labels and textbox. All these generates a report .
I want to print it out in MS Word format and also set print privew.
Here is my code for print for single textbox but i don't print in MS word.
So what to do?

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            PrintPreviewDialog1.ShowDialog()
        End Sub

        Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
            Dim font1 As New Font("arial", 11, FontStyle.Regular)
            e.Graphics.DrawString(IDtxt.Text, font1, Brushes.Black, 100, 100)
        End Sub

        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            PrintDocument1.Print()
        End Sub
2
Contributors
3
Replies
33
Views
3 Years
Discussion Span
Last Post by cgeier
0

sorry but this link is not opening.
Can u pl tell me another link

0

Create your report as a Word document using "Microsoft Word Object Library" (Microsoft.Office.Interop.Word).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.