Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello all:

 

I'm trying to create a general procedure for printing files, and have run into a snag. The procedure (see below) is intended to print a file using the Process class and ShellExecute, but I don't know all of the Arguments for the PrintTo Verb. I need to know if one of the Arguments can specify the number of copies to print (I hope). Anyone got an answer?

 

Public Sub Print_File(ByVal FilePath As String, ByVal Printer_Name As String, ByVal Num_Copies As Integer)

Dim Prt_Proc As New Process

 

Prt_Proc.StartInfo.FileName = FilePath

Prt_Proc.StartInfo.Verb = "PrintTo"

Prt_Proc.StartInfo.CreateNoWindow = True

Prt_Proc.StartInfo.Arguments = """" & Printer_Name & """"

Prt_Proc.StartInfo.UseShellExecute = True

Prt_Proc.Start()

Prt_Proc.WaitForExit()

Prt_Proc.Dispose()

 

End Sub

 

Thanks,

Jonathan

  • Administrators
Posted
It really depends on what is defined as the handler for the printto verb, you can check this via explorer by going into the Tools -> Options -> File Types tab and looking at the advanced properties. Be aware this will allow you to see how many parameters can be passed but won't tell you what they are - either google the appname or check any documentation that came with the application.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...