
- #Vbscript print to screen pdf#
- #Vbscript print to screen install#
- #Vbscript print to screen driver#
- #Vbscript print to screen code#
'Be sure a PDFCreator printer is the active printer Static pcQueue As Object 'PDFCreator.Queueĭim pcPrintJob As Object 'PDFCreator.PrintJob Static pcPrinter As Variant 'PDFCreator.Printers Optional ByVal JobCount As Long) As Boolean If Not PDFCreatorPrint("Z:\Test.PDF") Thenįunction PDFCreatorPrint(Optional ByVal PDFname, _ The reason is that the COM object of PDFCreator has changed since version 2.0ĭebug.Print "Can not initialize PDFCreator" So uninstalled the old, re-installed the new. Just to make sure it wasn't PDFCreator, I uninstalled it, re-installed the older version I used to use (before getting this new PC), same result. I am currently using PDFCreator 2.2, and yes it works splendidly when I print to it manually. Shell MyPath & " " & myfile, vbNormalFocus MyPath = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" Loop Until Dir(sPDFPath & sPDFName) = sPDFName
#Vbscript print to screen pdf#
'Wait until the file shows up before closing PDF Creator MsgBox "Can't initialize PDFCreator.", vbCritical + _ĪctiveSheet.PrintOut copies:=1, ActivePrinter:="PDFCreator on Ne01:" If IsEmpty(ActiveSheet.UsedRange) Then Exit Sub 'Check if worksheet is empty and exit if so Iret = MsgBox(strPrompt, vbOKCancel, strTitle) Sub PrintPDF() ' Save selected as PDF (and open it)
#Vbscript print to screen code#
Graham, above code is pretty much the same as my 'old' code, listed below: Graham Mayor (Microsoft Word MVP 2002-2019) For more Word tips and downloads visit my web site 'Manually change active printer to PDFCreator and run the macro to get the required syntax for the PC PrintToPDFCreator strName, strPath, ActiveSheet "Re-installing PDF Creator may restore normal working."Ĭonst strName As String = "Test Worksheet.pdf" "or its spooler blocked by AV software." & vbCr & vbCr & _ "This may be an indication that the PDF application has become corrupted, " & _ MsgBox "Unable to initialize PDFCreator." & vbCr & vbCr & _ 'Wait until PDF creator is finished then release the objects 'Wait until the print job has entered the print queue cOption("PDFUserPasswordString") = sUserPass 'To force a user to enter a password before opening cOption("PDFDisallowModif圜ontents") = iEdit cOption("PDFOwnerPasswordString") = sMasterPass 'The following are required to set security of any kind cStart("/NoProcessingAtStartup") = False Then Set pdfjob = CreateObject("PDFCreator.clsPDFCreator") If bNoPrint Then iPrint = 1 Else iPrint = 0Īpplication.ActivePrinter = "PDFCreator on Ne02:" 'See macro Test2 Sub PrintToPDFCreator(sPDFName As String, _ĭim iCopy As Integer, iPrint As Integer, iEdit As Integer
#Vbscript print to screen driver#
Use the Test macro to get the correct syntax for the PDFCreator driver and if necessary modify the line You can then use the following function to print from Excel.
#Vbscript print to screen install#
Make sure you only install the core program and not all the other junk that comes with it. While I don't normally disagree with fellow contributor Andreas (especially when it concerns Excel), I would be cautious about changing to the latest version of PDFCreator, which is a rather bloated version compared with version 1.73, which I find is theīest version, and it is still available from (e.g.) So now I have a program the can'tĭo a very basic function, can't go back to 2003, and I'm royally screwed. Some kind of postscript I believe? At any rate, a useless file that cannot be opened. While it does send the file to PDFCreator, and I do get a '.pdf' file, it's not pdf-FORMAT. The PrintOut function does not work either. QualityStandard and QualityMinimum produces exact same result. Having to do all this manually is equally a HUGE problem. Sound like much to some, it's a HUGE problem for me. Same file manually printed to pdf via PDFCreator produces a 22B file. YES, I know that 2016 now has a built-in print-to-pdf function (since 2013 I believe?). and all **** broke loose! ONE of my many problems is that my macrosįor print to pdf no longer function. Had macros that would print my various things to PDFCreator, thus giving me small (22KB) pdf files. I have been using Excel 2003 for many years.
