![]() Set AcroExchPDDoc = AcroExchAVDoc.GetPDDocĬall AcroExchAVDoc.PrintPages(0, num, 1, 1, 1)Ĭall AcroExchAVDoc.PrintPages(0, num, 2, 1, 1)Ĭall AcroExchAVDoc. 'Get the PDDoc associated with the open AVDoc Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc") ![]() Set AcroExchApp = CreateObject("AcroExch.App") ![]() Public Sub AcrobatPrint(FileName As String, PrintMode As String) I was lucky enough to come across this macro on this forum to save as pdf but I need to alter a bit so that it allows the user to select the folder to save. In the sample code below, pass the FileName and optional PrintMode values to the macro usingĪcrobatPrint "c:\My Documents\my-file.pdf", "All"ĪcrobatPrint "c:\My Documents\my-file.pdf" To use this code in Office applications, you need to set a reference to Acrobat in the VB Editor's Tools, References dialog box. To print only page 2, use 1 and 1 as the first 2 values:Ĭall AcroExchAVDoc.PrintPages(1, 1, 2, 1, 1) 1) select from the drop down menu, 2) print the main spreadsheet to PDF, save it as 'PPK 2.71, the name as it appears on the dropdown, and date (for example PPK 2.71-1-200226) 3) select the next item in the drop down menu 4) print to pdf (for example PPK 2. The page count begins with 0, not 1, so to print the first 3 pages, you'd use 0 and 2 as the first 2 values:Ĭall AcroExchAVDoc.PrintPages(0, 2, 2, 1, 1) For example, if you are printing a PDF and have Adobe Acrobat installed, you can use the PrintPages function in the Acrobat object model to print selected pages and shrink to fit the page.įunction PrintPages(nFirstPage As Long, nLastPage As Long, nPSLevel As Long, bBinaryOk As Long, bShrinkToFit As Long) As BooleanĬall the function in the macro using this format:Ĭall AcroExchAVDoc.PrintPages(0, 1, 2, 1, 1) To produce a PDF, specify an output file with a By default, pandoc will use LaTeX to create the PDF, which requires that a LaTeX engine be installed (see -pdf. If the application supports OLE, you may be able to control some aspects of the printout. You can use Windows Shell to print any document type, using the native application, assuming you have an application installed that can open and print the file type, but you can't set options, such as page numbers, using Windows Shell. In most cases you can't, because the print dialog is not exposed in the object model. I'm often asked how to control print settings when using a macro to print from Outlook.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |