Creating a PDF File
Posted on 2013-12-03
We are writing a program for ach transactions in our erp software. We have created a word template which will print a summary of the transaction. We also want the word template to be in pdf format. I have a print button with some test code that creates the pdf. The code works to a point but what is happening is that adobe reader will open and stays open in the task bar. It does not close automatically. If someone could help that would be great. Below is my test code:
The “CreateNoWindow” keeps the Adobe window from showing, but it’s still in the Taksbar tray.
For x = 1 To 1
strVendor = "1070"
Dim arrFile = "C:\Apps\86\PDFs\Remit_1140_66482_12022013_12022013135501_1.pdf"
Dim startInfo As New ProcessStartInfo
startInfo.FileName = strFile
startInfo.CreateNoWindow = True
startInfo.Verb = "print"
startInfo.Arguments = ""
startInfo.UseShellExecute = True
startInfo.CreateNoWindow = False
Dim reportPrint As Process = New Process
reportPrint.StartInfo = startInfo