"BobRoyAce" <broy@omegasoftwareinc.com> schrieb:
>I am using Visual Studio .NET 2005, using Visual Basic, to create a
> Windows Forms application. I want to add the ability to the application
> to print a PDF file that already exists when the user clicks on a
> button. Any ideas on how I can accomplish this?
Printing files of various types without user interaction
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=printinganyfile&lang=en>

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
BobRoyAce - 26 Aug 2006 07:41 GMT
Thanks for the pointer...that worked! I created a Sub that includes the
following code:
Dim psi As New ProcessStartInfo()
With psi
.Verb = "print"
.WindowStyle = ProcessWindowStyle.Hidden
.CreateNoWindow = True
.FileName = sFileName
.UseShellExecute = True
End With
Process.Start(psi)
Now, the only thing keeping this from being a perfect solution for me
is that it ends up opening up an instance of Acrobat reader (NOTE: I am
printing PDFs) which is then minimized in the taskbar. This is not a
terrible thing, mind you, but I would prefer if it weren't there. Is
there a way to eliminate this? I tried using the CreateNoWindow
parameter (see above), but that didn't do it.