In my vb.net program I allow users to print arbitrary documents using Process.start and loading the processstartinfo with the proper parameters:
Dim p As New System.Diagnostics.ProcessStartInfo
p.Verb = "Print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = report_to_run
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
This works well for filenames that are directly referenced (i.e. "C:\myfile.doc"). However, one customer wants to print docs that reside on their website. The filename would be like this "http:\\www.mysite.com\Mydoc.doc". When I execute the process.start with this filename I get a "bad parameter" message.
My assumption is that it's having a problem because the directly referenced filenames ("myfile.doc") kicks of MSWord directly and MSWord interprets the "print" parameter, where the filename "http:\www.mysite.com\myfile.doc" first goes through the web browser (IE) and the browser then kicks off MSWord.
My question is how can I get a web document to print programmatically?