Vb6 print to file3/12/2024 Set readerProcess = objShell.Exec(printJob) '- Get the Adobe Reader's process if first job PrintJob = Replace(printJob, "%2", PrinterName) PrintJob = Replace(printcmd, "%1", xfdfFileName) '- Replace printjob argument with the PDF file path Printcmd = objShell.RegRead("HKCR\" & pdfKey & "\shell\printto\command\") PrinterName = objShell.RegRead("HKCU\Sof tware\Micr osoft\Wind ows NT\CurrentVersion\Windows\ Device")ĪrDefaultPrinter = Split(PrinterName, ",") Set objShell = CreateObject("WScript.Shel l") '- Get the registry key of file association for ".pdf" Sub PrintPDF(xfdfFileName, pdfFileName, PrinterName)ĭim printcmd, printJob, pdfKey, arDefaultPrinter I am not married to any of this code and it is from examples I found elsewhere, so if there is a better or different way of doing this, I am happy to try it. This has been a major struggle for me so this is getting maximum point value. The subroutine for WaitForPrinter just doesnt seem to work and I am pulling my hair out trying to figure out why. The problem is that when I send the print job off, it is hit or miss as to wether it works or not. I have code already to launch Acrobat to print the document which I will include here for anyone that is interested. With Acrobat Reader, you can then print the merged document. Launching one of these files will merge the data from this XML file into an existing PDF Form file.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |