?
Solved

pdf printing and providing filename

Posted on 2003-10-27
5
Medium Priority
?
386 Views
Last Modified: 2010-05-01
Hello,

    I'm creating an application that needs the possiblity to generate PDF-files automatically without
    user interference.
    * Using "printing to the PDF-printer" doesn't allow my program to choose the new file/path so the user
       must deside every time.
    * Using the Acrobat Destiller works, but not for EXCEL files + I read somewhere that this is only for old
       versions of the Adobe PDF-writer.
    * I've allready tried some third-party software to, but nothing is sufficiant enough...

    can anyone help me with a link to a web-page or some example code on how to print to a pdf-file wich
    must be possible from Word/Excel (through automation) and must require NO user input.

thanx.
Bart
0
Comment
Question by:BartVergote
4 Comments
 
LVL 7

Expert Comment

by:_agj_
ID: 9625854
0
 
LVL 44

Accepted Solution

by:
bruintje earned 750 total points
ID: 9626154
title : print a PDF using the Acrobat Reader
source : http://www.planetpdf.com/mainpage.asp?WebPageID=90

description:
-----------
Option Explicit ' Force variable declaration
' Author : Karl De Abrew
' Company : A Round Table Solution
' Date : 30 November, 1998
' Description:
' This vb method uses the VB printer object and a command line call sourced from the Acrobat Developer FAQ to print a single PDF silently
' This method / function should be extended to suit the requirements
' of an organisation

Sub PrintAPDFUsingTheFreeAcrobatReader()

Dim strCommandLine As String
Dim strPrinterName As String
Dim strDriverName As String
Dim strPortName As String
Dim strFileNameToPrint As String

strFileNameToPrint = "c:\temp\filetoprint.pdf"

strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port

' Perform some error checking here
strCommandLine = "c:\acrobat3\reader\AcroRd32.exe /t """ + _
strFileNameToPrint + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """" 

If (Shell(strCommandLine, vbHide) <> 0)Then
MsgBox "Job has been sent to the printer using the command " + strCommandLine
End If
End Sub
-----------

hope this helps a bit
0
 
LVL 8

Expert Comment

by:ampapa
ID: 9633131
Do you have the full version of Acrobat? or are you just using Distiller?
0
 
LVL 1

Author Comment

by:BartVergote
ID: 9633728
I Use a full version of Acrobat.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question