Ask a questionAsk a question
 

AnswerNeed help making a program to send a file to printer

  • Wednesday, November 04, 2009 5:24 PMPenguinsfly1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I would like to make a small program that when opened would just send a particular file to be printed. Is this possible? Thanks for any help.

Answers

  • Wednesday, November 04, 2009 5:38 PMme.Ryan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    look at this:
    http://msdn.microsoft.com/nl-nl/vbasic/bb643800(en-us).aspx

    By Beth Massi


    Thanks for answering my questions, Please explain in code, and for other programming languanges than VB2008.net explain very clearly. My programming skills are:(1 to 5) Html = 4 php = 1 VB2008 = 3,5 c++ = 1 (starter)
  • Friday, November 06, 2009 2:53 AMJeff ShanMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Hi Penguinsfly1,

    I think you can try the following lines
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim psi As New ProcessStartInfo
            psi.UseShellExecute = True
            psi.Verb = "print"
            psi.WindowStyle = ProcessWindowStyle.Hidden
            psi.FileName = "C:\MyFile.doc" ' Here specify a document to be printed
            Process.Start(psi)
        End Sub
    End Class
    
    Regards
    Jeff Shan
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

All Replies

  • Wednesday, November 04, 2009 5:38 PMme.Ryan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    look at this:
    http://msdn.microsoft.com/nl-nl/vbasic/bb643800(en-us).aspx

    By Beth Massi


    Thanks for answering my questions, Please explain in code, and for other programming languanges than VB2008.net explain very clearly. My programming skills are:(1 to 5) Html = 4 php = 1 VB2008 = 3,5 c++ = 1 (starter)
  • Friday, November 06, 2009 2:53 AMJeff ShanMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Hi Penguinsfly1,

    I think you can try the following lines
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim psi As New ProcessStartInfo
            psi.UseShellExecute = True
            psi.Verb = "print"
            psi.WindowStyle = ProcessWindowStyle.Hidden
            psi.FileName = "C:\MyFile.doc" ' Here specify a document to be printed
            Process.Start(psi)
        End Sub
    End Class
    
    Regards
    Jeff Shan
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.