Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
print PDF file from Excel - NOT print Excel to PDF?
I have a column that has catalog items in it. My plan is to have the macro
read each catalog item and then print out a corresponding MSDS (material data safety sheet) that is located on a server in a PDF format. Is it possible to open the PDF file using VBA and print it? I would prefer if this all took place unseen, maybe the only thing seen would be the print dialog, to set number of copies. Thanks for any help, Alan Ibbotson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
print PDF file from Excel - NOT print Excel to PDF?
Alan,
I'd use the API ShellExceute here. That way you can leave the OS to decide which app should print the file. Not tested, but something like this : Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Dim RetVal As Long RetVal = ShellExecute(&O0, "print", Range("A1").Value, vbNullString, ThisWorkbook.Path, &O0) if retval<=32 then msgbox "Couldn't print: See http://www.allapi.net/apilist/ShellExecute.shtml" else 'OK, continue end if NickHK Alan Ibbotson wrote: I have a column that has catalog items in it. My plan is to have the macro read each catalog item and then print out a corresponding MSDS (material data safety sheet) that is located on a server in a PDF format. Is it possible to open the PDF file using VBA and print it? I would prefer if this all took place unseen, maybe the only thing seen would be the print dialog, to set number of copies. Thanks for any help, Alan Ibbotson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
First page of Excel sheerepeats in print layout or print preview | Excel Discussion (Misc queries) | |||
my excel is converting all my print jobs to print to file why? | Excel Discussion (Misc queries) | |||
How to format the extension less file to print with Dos's Print Command | Excel Discussion (Misc queries) | |||
print and print preview not active in file drop down | Excel Discussion (Misc queries) | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming |