MMQQ
07-17-2008, 03:41 PM
Hello,The following code will convert my current excel doc to pdf. But how can I change it so that it knows to converted to legal size for when people print the pdf doc? In Excel it is set to legal size already.Sub PDFConversionAndSave(TabNametoPrint As String)Dim OriginalPrinter As StringDim pdfDist As New ACRODISTXLib.PdfDistiller'unless user of this template manually goes to Print, Select Adobe PDF, and in' properties, uncheck [Do not send fonts to "Adobe PDF"], macro will crash and we'll have to be rerun.'As of Jan 08, checked google and various sites saying that currently this step' can't be programmed, so must be done manually. 'Generate PS file in selected folder Worksheets(TabNametoPrint).Activate Application.DisplayAlerts = True 'Print to PS file in nominated folder ActiveWindow.SelectedSheets.PrintOut Copies:=1, preview:=False, ActivePrinter:=PDFPrinter, printtofile:=True, collate:=True, prtofilename:=FilePathToSave & FileNameToSave & ".ps" 'Convert PS to PDF using the method from PDFDistiller class pdfDist.FileToPDF FilePathToSave & FileNameToSave & ".ps", FilePathToSave & FileNameToSave & ".pdf", "" Application.DisplayAlerts = True Set pdfDist = Nothing 'Clears the pipes Kill (FilePathToSave & FileNameToSave & ".ps") Kill (FilePathToSave & FileNameToSave & ".log")End SubThanks,MM
Sorry...wrap tabs icon disabled on my computer.
Sorry...wrap tabs icon disabled on my computer.