Printing PDF from code
Normally you can print document using ShellExecute API with Print parameter. This also works for PDF, but leaves Acrobat Reader open. Imagine what can you get on a screen after multiple document printing? But fortunately - there is a way to close it after print, using old technology - DDE (remember this one? It was the only way to communicate with external program before OLE Automation). Here a procedure to print PDF files from VBA code. Originally I found some parts this code on internet, but can't find source anymore. So if you saw parts of it somewhere - please let me know, I will put a link and reference message.
Now I am posting VBA code in separate HTML pages on PointLtd site, after several tries to find a good way to post code here this way looks more attractive for me, and hopefully for readers also.



3 Comments:
This report to PDF code works well. It uses DLLs that convert from snapshot format to PDF.
Ciao Alex!!! :-)
When you call the PrintPDF function, what do you use as FileName, an exe file, an snp file or a pdf file?
Ciao Giorgio!
Should be pdf file
Post a Comment
Links to this post:
Create a Link
<< Home