ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing pdf (https://www.excelbanter.com/excel-programming/342250-printing-pdf.html)

Robert Dieckmann

Printing pdf
 
Is it possible to print a pdf file through vba? If so, how? I would prefer
to do this rather than import into my spreadsheet to keep the size down. I
use Excel 2000.

Robert



asmenut

Printing pdf
 
Robert,
If you have Adobe Acrobat or some 3rd party pdf drivers, then:
Application.ActivePrinter = "Adobe PDF on Ne01:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Adobe PDF on Ne01:", Collate:=True

(Note: Use record macro to see what default pdf driver is chosen).

"Robert Dieckmann" wrote:

Is it possible to print a pdf file through vba? If so, how? I would prefer
to do this rather than import into my spreadsheet to keep the size down. I
use Excel 2000.

Robert




Robert Dieckmann

Printing pdf
 
Perhaps my question was unclear. I already have the pdf file which was
generated from AutoCAD. I want to send that file to a standard printer
along with some related information from the spreadsheet. I am not
looking to create a pdf file from the spreadsheet, I already have that
covered. What I want to avoid is having to import the AutoCAD drawing
into my spreadsheet in order to print it. I am distributing my
spreadsheet to others within the company who do not have access to
AutoCAD & I am trying to simplify the process for them so that they can
print what they need with the click of a button. Sorry for the
miscommunication.



*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

Printing pdf
 
I had luck using the Shell command:


Sub Tester2a()
Shell "C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe" & _
" c:\toc1\amcr37-4.pdf", 1
' the following prints the document
Application.SendKeys "^p~", False
End Sub


or if you have .pdf associated with acrobat reader:


Private Sub CommandButton1_Click()
Shell "Start.exe ""D:\My Documents\sm569_Jan2001\tute6.pdf"""
Application.SendKeys "^p~", False
End Sub


--
Regards,
Tom Ogilvy


"Robert Dieckmann" wrote in message
...
Perhaps my question was unclear. I already have the pdf file which was
generated from AutoCAD. I want to send that file to a standard printer
along with some related information from the spreadsheet. I am not
looking to create a pdf file from the spreadsheet, I already have that
covered. What I want to avoid is having to import the AutoCAD drawing
into my spreadsheet in order to print it. I am distributing my
spreadsheet to others within the company who do not have access to
AutoCAD & I am trying to simplify the process for them so that they can
print what they need with the click of a button. Sorry for the
miscommunication.



*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com